Quantcast
Channel: Virtual Machine Manager – General forum
Viewing all articles
Browse latest Browse all 2770

how to get the VMs name via powershell command

$
0
0

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






Viewing all articles
Browse latest Browse all 2770

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>