| Author |
Topic  |
|
|
Analyzer
Yak Posting Veteran
United Kingdom
78 Posts |
Posted - 11/13/2012 : 07:22:51
|
New to PS and trying to build an inventory framework.
Sourced various .ps1 scripts from net, modified some. Can get a few scripts to work however most of them execute without any errors - however - I don't get any results. Not in shell, .txt or piping using cmdlets Out-file, write-file.
Any ideas what is preventing the scripts from producing results? They still don't work when runas 'admin', inside SQL module and Set-ExecutionPolicy Unrestricted.
Invoke-Sqlcmd2 -ServerInstance <svr_name> -Query "PRINT 'hello world'" -Verbose, |
|
|
sunitabeck
Flowing Fount of Yak Knowledge
5152 Posts |
Posted - 11/13/2012 : 07:43:53
|
quote: Originally posted by Analyzer
New to PS and trying to build an inventory framework.
Sourced various .ps1 scripts from net, modified some. Can get a few scripts to work however most of them execute without any errors - however - I don't get any results. Not in shell, .txt or piping using cmdlets Out-file, write-file.
Any ideas what is preventing the scripts from producing results? They still don't work when runas 'admin', inside SQL module and Set-ExecutionPolicy Unrestricted.
Invoke-Sqlcmd2 -ServerInstance <svr_name> -Query "PRINT 'hello world'" -Verbose,
These may be typos that is only in your posting, but the comma at the end causes Powershell to think that the command is not complete.
Also, Invoke-Sqlcmd2 - I am not familiar with it, but I see in the code repository as an improved version that avoids timeouts. Does simple Invoke-Sqlcmd work for you? |
Edited by - sunitabeck on 11/13/2012 07:45:42 |
 |
|
| |
Topic  |
|
|
|