2016-03-05 16:41:18 +00:00
|
|
|
Param(
|
|
|
|
[Parameter(Mandatory=$true)]
|
|
|
|
[string]$VmId
|
|
|
|
)
|
|
|
|
|
2017-08-08 17:00:29 +00:00
|
|
|
$VM = Hyper-V\Get-VM -Id $VmId -ErrorAction "Stop"
|
|
|
|
$Snapshots = @(Hyper-V\Get-VMSnapshot $VM | Select-Object Name)
|
2016-03-05 16:41:18 +00:00
|
|
|
$result = ConvertTo-json $Snapshots
|
|
|
|
|
|
|
|
Write-Host "===Begin-Output==="
|
|
|
|
Write-Host $result
|
|
|
|
Write-Host "===End-Output==="
|