473,378 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Powershell questions??

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
Jun 14 '07 #1
3 2656
Thomas W. Brown wrote:
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/microsof...ows.powershell

Andrew
Jun 14 '07 #2
"Thomas W. Brown" <th************@countrywide.NOSPAM.comwrote in message
news:F2**********************************@microsof t.com...
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"

Jun 14 '07 #3
"John Vottero" wrote:
"Thomas W. Brown" <th************@countrywide.NOSPAM.comwrote in message
news:F2**********************************@microsof t.com...
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"
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

Jun 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Neil Chambers | last post by:
Hi All, I'm looking to see if it's feasible to use the SortObjectCommand included in the Microsoft.Powershell.Commands assembly. I have a Dictionary Dictionary<string, intd = new...
6
by: Mesan | last post by:
Does anyone have an idea what it takes to administer DB2 through PowerShell? I want to write some scripts to automate my common DB2 management tasks and I'd really like to be able to use...
1
by: Alexander Vasilevsky | last post by:
Hi! How to debug Powershell commandlets? -- http://www.alvas.net - Audio tools for C# and VB.Net developers
5
by: josepharmbruster | last post by:
I am all about using the right tool for the right purposes, which is why I have started reading the GettingStarted guide to PowerShell. I am curious if any other pythoneers have ventured into the...
3
by: sridhard2406 | last post by:
Hi I didn't find a forum for powershell so i'm my query here itself. I'm runnung a powershell script and i want to redirect the output to a xml after redirecting the output i need to search a...
0
by: =?Utf-8?B?SmVycnk=?= | last post by:
Hi, I just don't get it :( I'm using VB.NET code, within this code I want to call some Powershell code. (To create a user mailbox in Exchange 2007). How can I run Powershell code in vb.net?...
3
by: shalong | last post by:
Hi all, I want to run a python script to create a large number of Exchange mailboxes. I am using the os.system("New-Mailbox.......) method. However if i try to execute the python script in...
1
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i read the MS kb: Using Exchange Management Shell Commands With Managed Code http://msdn.microsoft.com/en-us/library/bb332449.aspx how ever i'm getting "{"No Windows PowerShell Snap-ins are...
1
by: SCRIPT KEEPER | last post by:
Hello, I am a complete noob and just starting off with csharp so I apologize for my basic question. I am wanting to start powershell from inside a batch script and then to pass the powershell args...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.