Powershell script the line. highlighted line. any suggestion what am missing here?
getting error
============
Get-VM : 5/22/2020 10:18:50 AM Get-VM VM with id 'VirtualMachine-vm-272891' was not found using the specified filter(s).
At line:40 char:23
+ $VMname = Get-VM -id $($OneDetail.MoRef)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-VM], VimException
+ FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM
Get-VM : 5/22/2020 10:18:53 AM Get-VM VM with id 'VirtualMachine-vm-67421' was not found using the specified filter(s).
At line:40 char:23
+ $VMname = Get-VM -id $($OneDetail.MoRef)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-VM], VimException
+ FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM
Get-VM : 5/22/2020 10:18:50 AM Get-VM VM with id 'VirtualMachine-vm-272891' was not found using the specified filter(s).
At line:40 char:23
+ $VMname = Get-VM -id $($OneDetail.MoRef)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-VM], VimException
+ FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM
Get-VM : 5/22/2020 10:18:53 AM Get-VM VM with id 'VirtualMachine-vm-67421' was not found using the specified filter(s).
At line:40 char:23
+ $VMname = Get-VM -id $($OneDetail.MoRef)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (:) [Get-VM], VimException
+ FullyQualifiedErrorId : Core_OutputHelper_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM
I think the error message is quite clear, the cmdlet can not find a VM with the ID VirtualMachine-vm-272891
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i compared the report with Vm name, actually there is no vm name its hows as some numbers or vm not found. after more analysis i found that those vms are no longer on PROD SRM site but still it showing on DR SRM configuration.
any suggestion how can be say like show me anything either its number of or any data on the place of vm name (if vm name is not proper)
am about to close this SRM report only this point is pending. after that will share the full script here.
If you already have the MoRef of the VM, why not use that instead of VMName?
CRad14
actually not sure how to fetch that info. any suggestion