I have a PSHost object executing a Powershell script myscript.ps1 and that .ps1 script is executing sqlcmd.exe to get what it needs done. Is there a way to keep it from popping up empty sqlcmd dos prompts (as it seems to do)?
Asked
Active
Viewed 747 times
2 Answers
0
For example: http://blog.sapien.com/index.php/2006/12/26/more-fun-with-scheduled-powershell
You're going to have to wrap sqlcmd.exe in something else as PowerShell isn't able to AFAIK.
From a scripting perspective, this does change for powershell.exe in v2, but I'm not sure that is available in SDK for custom hosts.

Marco Shaw
- 1,117
- 6
- 13
0
instead of calling sqlcmd.exe why not just call the Invoke-SQLCmd cmdlet that comes when you install SSMS?