Hello!
I am running into an issue when searching for ISOs. When a datastore is marked as 'Inactive', instead of the script continuing, it is halting on the inaccessible datastore.
dir vmstores:\ -Recurse -include *.iso | Select Name,FolderPath
dir : Datastore 'vmrepo1-rep1' is not accessible. No connected and accessible host is attached to this datastore.
At C:\locateisos.ps1:2 char:1
+ dir vmstores:\ -Recurse -include *.iso | Select Name,FolderPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ChildItem], InaccessibleDatastore
+ FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.InaccessibleDatastore,Microsoft.PowerShell.Commands.GetChildItemCommand
Is there a way to pass an exclude arg if the datastore is marked 'Inactive'?