Get-WMIObject MSCluster_ResourceGroup -ComputerName MYEXCHANGE01 -Namespace
root\mscluster -filter "name='Cluster Group'" | Format-Table __Server
When I launch it from a command line:
powershell.exe -psconsolefile "D:\Program Files\Microsoft\Exchange
Server\bin\exshell.psc1" -command Get-WMIObject MSCluster_ResourceGroup
-ComputerName MYEXCHANGE01 -Namespace root\mscluster -filter "name='Cluster
Group'" | Format-Table __Server
I get:
'Format-Table' is not recognized as an internal or external command,
operable program or batch file.
How can I get this to work?
Thanks.
powershell.exe -psconsolefile "D:\Program Files\Microsoft\Exchange
Server\bin\exshell.psc1" -command "Get-WMIObject MSCluster_ResourceGroup
-ComputerName MYEXCHANGE01 -Namespace root\mscluster -filter name='Cluster
Group' | Format-Table __Server"
The main idea is to wrap double quotes around the PowerShell command, and not
using them inside the PowerShell command. The pipe was being interpreted at the
cmd.exe level and not the PowerShell level.
- Larry