Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions builder/hyperv/common/powershell/hyperv/hyperv.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,10 @@ param([string]$vmName)
$generation = Hyper-V\Get-Vm -Name $vmName | %{$_.Generation}
if (!$generation){
$generation = 1
} elseif ($generation.toString() -notmatch "\d"){
throw "Unable to parse VM generation. Are there multiple VMs with the name $vmName?"
} else {
return $generation
}
return $generation
`
Expand Down
4 changes: 4 additions & 0 deletions builder/hyperv/common/powershell/powershell.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ param([string]$vmName)
$generation = Hyper-V\Get-Vm -Name $vmName | %{$_.Generation}
if (!$generation){
$generation = 1
} elseif ($generation.toString() -notmatch "\d"){
throw "Unable to parse VM generation. Are there multiple VMs with the name $vmName?"
} else {
return $generation
}
return $generation
`
Expand Down