Hi all:
I can get the VMs name for the specific host via the command "Get-VM" as below:
PS E:\> Get-VM -ComputerName 172.18.139.240 | Where-Object {$_.State –eq 'Running'} | select name |select Name | foreach {$_.Name}
win2008
win7
SO, I can get the VMs name win2008 and win7
I want to get the VMs String, But it is error format as below line:
$VMname =Get-VM -ComputerName 172.18.139.240 | Where-Object {$_.State –eq 'Running'} | select name |select Name | foreach {$_.Name}
The error info:
powershell : Get-SCVirtualMachine : A parameter cannot be found that matches parameter name
Why ? I think "Get-VM -ComputerName 172.18.139.240 | Where-Object {$_.State –eq 'Running'} | select name |select Name | foreach {$_.Name}" is String not table