Unix To PowerShell – Cut
PowerShell is definitely gaining momentum in the windows scripting world but I still hear folks wanting to rely on Unix based tools to get their job done. In this series of posts I’m going to l...
Published May 06, 2009
Version 1.0Sep 08, 2009
I think your issue isn't with the passing in of the command but rather with how your command is formulated. When I tried to enter just the "get-wmiobject ..." directly into powershell I got the same error. The issue is with the code after the second pipe. I'd try something like this:
"Get-WMIObject -class MSFT_SPIESUserSetting | where-object { $_.PrimaryURI -eq 'sip:Navin@OCSR2.COM' } | foreach-object -process { $_.Enabled = $True; $_.put() | out-null; }"
I've put a foreach-object before your last expression block and it seems to work for me.
Let me know how it goes...
-Joe