Powershell questions??

G

Guest

1. Is there a dedicated discussion group for Windows Powershell? I couldn't
find one, but that doesn't necessarily mean there isn't :)

2. I'm just starting in on learning to use Powershell and doing so by slowly
(very slowly) attempting to port some existing CMD and Perl scripts. I'm
blocked right now on something that should be very simple (I would think)...

I want to use SQLCMD to issue a query and parse/format the return string.
But when I enter the command to the Powershell prompt:

sqlcmd -S server -d database -E -Q"query"

It just returns to a ">>" prompt as if its waiting for the completion of the
command and nothing I enter seems to "complete" the command. A Ctrl+C
returns me to the main Powershell prompt without executing the command.

What am I missing??

Thanks,
-- TB
 
A

Andrew Morton

Thomas said:
1. Is there a dedicated discussion group for Windows Powershell? I
couldn't find one, but that doesn't necessarily mean there isn't :)

news://msnews.microsoft.com/microsoft.public.windows.powershell

Andrew
 
J

John Vottero

Thomas W. Brown said:
1. Is there a dedicated discussion group for Windows Powershell? I
couldn't
find one, but that doesn't necessarily mean there isn't :)
microsoft.public.windows.powershell


2. I'm just starting in on learning to use Powershell and doing so by
slowly
(very slowly) attempting to port some existing CMD and Perl scripts. I'm
blocked right now on something that should be very simple (I would
think)...

I want to use SQLCMD to issue a query and parse/format the return string.
But when I enter the command to the Powershell prompt:

sqlcmd -S server -d database -E -Q"query"

It just returns to a ">>" prompt as if its waiting for the completion of
the
command and nothing I enter seems to "complete" the command. A Ctrl+C
returns me to the main Powershell prompt without executing the command.

What am I missing??

What's the whole command? I don't have that problem.

Here's the SQL command that works for me:

PS C:\> sqlcmd -S server -E -d DB -Q "select * from table"
 
G

Guest

John Vottero said:
What's the whole command? I don't have that problem.

Here's the SQL command that works for me:

PS C:\> sqlcmd -S server -E -d DB -Q "select * from table"

Doh!!! I was not adding whitespace between the -Q and quoted query. From
the regular CMD shell no space is necessary, but in Powershell I guess it is
:-/

Thanks,
-- TB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top