VMware

Creating a PSDrive to browse your inventory

VERSION 3 Published

Created on: Mar 15, 2008 11:33 AM by halr9000 - Last Modified:  Nov 18, 2008 12:15 PM by halr9000

(I can't take credit for this, I'm just formatting and publishing instructions received from VMware.)

  1. Establish a connection to your the server using the Connect-VIServer command:
    Connect-VIServer -Server
    

    for example,
    Connect-VIServer -Server 192.168.10.10
    

    When prompted, provide the administrator's username and password to authenticate access on the server.
  2. Get the root folder of the server:
    $root = Get-Folder -NoRecursion
    
  3. Create a PowerShell drive named VI, based on the server root folder. You can use the built-in New-psDrive cmdlet.
    New-PSDrive -Location $root -Name vi -PSProvider VimInventory -Root '\'
    

    In this release, a single backslash is the required value for the -Root parameter.
  4. Access the new drive by typing the following command:
    cd vi:
    

    To list the drive content, use Get-ChildItem or its alias Dir.
  5. Navigate through your server inventory using the cd command with the full path to the host. For a fictional VI inventory it may looks like the following:
    cd Folder01\DataCenter01\host\Web\LiveHost01
    
Average User Rating
(0 ratings)




There are no comments on this document

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities