Hyper-V-Reporting-Script icon indicating copy to clipboard operation
Hyper-V-Reporting-Script copied to clipboard

Error on windows server 2022

Open hvdcgkl opened this issue 2 years ago • 2 comments

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

  • ... $vmDiffDisk = Get-VHD -ComputerName $VMHostItem -Path $parentPath
  •                                                           ~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Get-VHD], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Vhd.PowerShell.Cmdlets.GetVHD

hvdcgkl avatar Aug 14 '23 15:08 hvdcgkl

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

hvdcgkl avatar Aug 16 '23 07:08 hvdcgkl

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

revtex avatar Jun 12 '24 20:06 revtex