I did this:
That works fine. I was able to gci to see the datacenters. I then created a few new datacenters, and was able to see them as well. Then, a few minutes later the following happened:
I removed the drive, then started the procedure over again, thinking some object got stale. Again, gci, or anything else I try fails.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
PS >$root = Get-Folder -NoRecursion
PS > New-PSDrive -Name VI -PSProvider VIMInventory -Root '\' -location $root
Name Provider Root CurrentLocation
---- -------- ---- ---------------
VI VimInventory \ID\443@vcenter\Folder-group-d1 \
That works fine. I was able to gci to see the datacenters. I then created a few new datacenters, and was able to see them as well. Then, a few minutes later the following happened:
PS > cd vi:
VI:\..\Folder-group-d1
PS > dir
Get-ChildItem : Cannot find path '\ID\443@vcenter\Folder-group-d1\..\Folder-gr
oup-d1' because it does not exist.
At line:1 char:4
+ dir <<<<
I removed the drive, then started the procedure over again, thinking some object got stale. Again, gci, or anything else I try fails.
Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Tags:
new-psdrive,
vimautomation,
psprovider