ask for VM by name to reduce looping.

This commit is contained in:
Megan Marsh 2019-11-08 16:20:03 -08:00
parent be0e9f7816
commit ae184fe31d
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ func DoesVirtualMachineExist(vmName string) (bool, error) {
var script = `
param([string]$vmName)
return (Hyper-V\Get-VM | ?{$_.Name -eq $vmName}) -ne $null
return (Hyper-V\Get-VM -Name $vmName | ?{$_.Name -eq $vmName}) -ne $null
`
var ps PowerShellCmd