HI gurus
I am looking for a PSCLI script that will go on all datastores in a cluster and look for a particular VM folder.
Is this possible
Thanks
My bad, that was from my test run.
I corrected the code above.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, you could do something like this
$folderName = 'folder'
Get-Cluster -Name $clusterName | Get-Datastore |
ForEach-Object -Process {
New-PSDrive -Location $_ -Name DS -PSProvider VimDatastore -Root '\' | Out-Null
Get-ChildItem -Path DS: -Filter $folderName -Recurse |
Select Name,DatastoreFullPath
Remove-PSDrive -Name DS -Confirm:$false
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
L.
As always crazy good, thanks a bunch for the script, is there a way that get-datastore gets all Datastore instead of chaging vsandatastore for every inquiry? or get like a wild(*) in folder ?
if not possible its cool also as well.
Thanks again
My bad, that was from my test run.
I corrected the code above.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
as always worked like a charm!!!!!!
Thanks