ghostinthewires / Hyper-V-Reporting-Script

42 stars 33 forks source link

Error on windows server 2022 #5

Open hvdcgkl opened 1 year ago

hvdcgkl commented 1 year ago

Hi,

the script works on server 2012 R2 but i have this error on server 2022, could you help me ?

Get-VHD : Cannot validate argument on parameter 'Path'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At C:\Tools\Old\Get-HyperVReport.ps1:2226 char:83

hvdcgkl commented 1 year ago

My solution : i have put in comment the line 2226 ($vmDiffDisk = Get-VHD -ComputerName $VMHostItem -Path $parentPath) and the the script works...

revtex commented 3 months ago

Change Until ($parentPath -eq $null) to Until ($parentPath -eq "")