Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
avipenina
Starting Member
44 Posts |
Posted - 2014-09-05 : 17:21:28
|
Hi,i run this powershell command EXEC xp_cmdshell 'powershell "Get-WmiObject -class win32_processor"'and i get some of the results in two lines instead of one line when i run it in a real powershell commandexample: Name : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHzthe 2.10GHZ in this example go into second line...why is that and how it can be resolved to one line like real powershell command THX |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-05 : 17:31:50
|
How are you using the results? If you are storing it in a table, you can remove the extra line (maybe it's CHAR(10) or CHAR(13), or both). I would not advise running powershell commands in T-SQL though. xp_cmdshell should really be disabled, especially if this is a production instance. Instead, run powershell commands from command line. If you need to store it in a table, then do that through powershell too.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|