mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-02-03 20:39:27 -05:00
20 lines
432 B
PowerShell
20 lines
432 B
PowerShell
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: BUSL-1.1
|
|
|
|
#Requires -Modules VagrantMessages
|
|
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[string]$VmId
|
|
)
|
|
|
|
try {
|
|
$VM = Hyper-V\Get-VM -Id $VmId
|
|
$Disks = @(Hyper-V\Get-VMHardDiskDrive -VMName $VM.Name)
|
|
} catch {
|
|
Write-ErrorMessage "Failed to retrieve all disk info from ${VM}: ${PSItem}"
|
|
exit 1
|
|
}
|
|
|
|
$result = ConvertTo-json $Disks
|
|
Write-OutputMessage $result
|