Get-DBaComputerSystem Pipeline sql result #7441
-
the following command doesn't success What is the issue with data produced by sql request . Which step to introduce between the sql result and pipeline ? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
PS C:\Users\a-xxxxxx> Invoke-DbaQuery -SqlInstance 'xxxxx\SQLS02' -Query 'SELECT distinct top 1 [ComputerName] FROM [DBA_Maintenance].[dbo].[Repos_instances-prod]'|echo |Get-DbaComputerSystem
PS C:\Users\a-xxxxxx> echo WWWIN028 |Get-DbaComputerSystem ComputerName : WWWINxxx |
Beta Was this translation helpful? Give feedback.
-
Get-DbaComputerSystem accepts a "rich" instance object or a plain string that can pipelined to it. Now, the output from the query is an object whose property ComputerName is the string you may pass to Get-DbaComputerSystem I think you may fix it with
|
Beta Was this translation helpful? Give feedback.
-
If your query returns just one column, use
|
Beta Was this translation helpful? Give feedback.
-
Super Andreas , it works fine . thank you so much . JP |
Beta Was this translation helpful? Give feedback.
If your query returns just one column, use
-As SingleValue
: