Powershell questions??

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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"
 
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
 
Back
Top