January 1, 2012 at 12:00 am #5250
by Lembasts at 2012-10-30 21:23:31
I am running v3 of Powershell and typed in "help get-wmiobject -full".
Looking at the -computername parameter, it says in the text "This parameter can also be piped..."
But below that it says "Accept pipeline input? false"
And the parameter says "-ComputerName
" which indicates a string array.
So why does it say false for accept pipeline input?
by mikefrobbins at 2012-10-31 08:26:53
Based on my testing, Get-WMIObject does not accept pipeline input for the computername parameter.
Get-WMIObject : The input object cannot be bound to any parameters for the command either because the command does not
take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
The online version of the help for that cmdlet says the same thing.
Looks like this issue has been reported on Microsoft Connect: http://connect.microsoft.com/PowerShell/feedback/details/769311/get-wmiobject-help-file-for-computername-may-be-incorrect
If you're using PowerShell version 3, you could always use the Get-CimInstance cmdlet which does allow pipeline input for the computername parameter.
by Jason_Yoder_MCT at 2012-10-31 08:32:56
Remember that anytime you feel you found a bug in Microsoft products, you can go to Microsoft Connect and report it. I went ahead and reported the bug. I have a meeting tomorrow with the individual who writes the help files for PowerShell and I'll mention this to her. Below is the code that I used to verify that the documentation is incorrect.
# This code works
Get-WMIObject Win32_Bios -ComputerName Server1, Server 2
# This code does not work
Server1 | Get-WMIObject Win32_Bios
by mikefrobbins at 2012-10-31 08:39:46
Looks like Jason was submitting it while I was searching connect to see if it already existed. I always try to search to see if someone else already submitted it on connect and vote the existing issue up if it's something important instead of creating a duplicate issue.
by Lembasts at 2012-10-31 13:40:26
Thanks – I wasnt sure so I was just checking. Thanks for confirming...
You must be logged in to reply to this topic.