VMware Communities > Developer Community > VI Toolkit (For Windows) - Beta > Discussions
Actions

This Question is Not Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
4 Replies Last post: May 20, 2008 7:03 AM by halr9000
Reply

VimInventory PSProvider stops working

May 15, 2008 1:14 PM

Click to view halr9000's profile Expert halr9000 303 posts since
Jun 7, 2007
I did this:
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)
Reply Re: VimInventory PSProvider stops working May 15, 2008 1:58 PM
Click to view LucD's profile Expert LucD 308 posts since
Oct 31, 2005
Hal, I suppose you created the new datacenters from the VI client.
When I tried this in the past (with New-Item) I got a "...the provider does not support this operation" message.
Reply Re: VimInventory PSProvider stops working May 15, 2008 4:28 PM
in response to: LucD
Click to view halr9000's profile Expert halr9000 303 posts since
Jun 7, 2007
I actually had not gotten that far (was going to be the very next thing to try), but I'm not surprised. I just happened to think of new-datacenter first. :)

Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Reply Re: VimInventory PSProvider stops working May 20, 2008 4:34 AM
Click to view rusev's profile Novice rusev 7 posts since
Mar 4, 2008

Hi Hal,

I am trying to investigate if this is a problem. Could you confirm this is correct:

1. You have created folder 'Folder-group-d1'
2. Then you changed the Current dir to this folder
3. Then may be you /or someone else/ accidently have deleted the folder
4. Now in the provider you are in folder 'Folder-group-d1' which does not exist.
5. In this situation you execute the command 'cd vi:' This command does not change current context, on the contrary the context stays the same - 'Folder-group-d1' which does not exist and thus the the error appears.
6. If the command to be executed was 'cd vi:\' then this would have triggered context change to root directory and no error would be observed because the root context is there.

Thank you,

Georgi Rusev

Reply Re: VimInventory PSProvider stops working May 20, 2008 7:03 AM
in response to: rusev
Click to view halr9000's profile Expert halr9000 303 posts since
Jun 7, 2007
Nope, and I tried it again with a newer build, same issue.

53# Get-Folder -NoRecursion | New-PSDrive vi -PSProvider viminventory -Root '/'
 
Name       Provider      Root                                                  CurrentLocation
----       --------      ----                                                  ---------------
vi         VimInventory  \ID\443@mojito\Folder-group-d1                                      \
 
 
54# cd vi:
vi:\..\Folder-group-d1
55# dir
Get-ChildItem : Cannot find path '\ID\443@mojito\Folder-group-d1\..\Folder-group-d1' because i
t does not exist.
At line:1 char:4
+ dir <<<<


Hal Rottenberg
Co-Host, PowerScripting Podcast (http://powerscripting.net)