Hello,
Can someone give me an example of the PowerCLI code to check wether a virtual exist or not?
Vincent
I assume you want to check if a vritual machine exists or not.
One, simple, method of doing this could be
$MyVM = Get-VM -Name "DoYouExist" -ErrorAction SilentlyContinue if($MyVM -eq $null){ Write-Host "VM doesn't exist" }
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I assume you want to check if a vritual machine exists or not.
One, simple, method of doing this could be
$MyVM = Get-VM -Name "DoYouExist" -ErrorAction SilentlyContinue if($MyVM -eq $null){ Write-Host "VM doesn't exist" }
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That's what was I'm looking for! Thanks for the help.