+ This disambuguates calls to the Hyper-V functions for the Hyper-V provider. The ambiguity of some commands - such as `Get-VM` - causes the Hyper-V provider to fail on systems where VMware PowerCLI is installed. This change ensures that all calls to Hyper-V specific cmdlets or functions are prepended by `Hyper-V\`. This ensures the correct cmdlet calls are being made. + Resolves #8862.
13 lines
294 B
PowerShell
13 lines
294 B
PowerShell
Param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$VmId
|
|
)
|
|
|
|
$VM = Hyper-V\Get-VM -Id $VmId -ErrorAction "Stop"
|
|
$Snapshots = @(Hyper-V\Get-VMSnapshot $VM | Select-Object Name)
|
|
$result = ConvertTo-json $Snapshots
|
|
|
|
Write-Host "===Begin-Output==="
|
|
Write-Host $result
|
|
Write-Host "===End-Output==="
|