• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Management & Automation

VI Powershell: Creating a PSDrive to browse your inventory

Duncan Epping · Mar 26, 2008 ·

Just stumbled upon this cool article about mounting your VI inventory as a drive via Powershell:

source – Hal Rottenberg aka halr9000:

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


    for example,

    Get-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
    

Powershell Toolkit beta coming up and VMworld lab PDF!

Duncan Epping · Mar 10, 2008 ·

Eric Sloof just pointed us out to the Blog on the VMware website about the upcoming Powershell Toolkit Beta. I have been playing around with this toolkit for a while but had a hard time figuring out how to actually make useful scripts. The PDF that was also released has some cool examples of useful scripts for instance these:

Change the number of virtual CPUs configured for “Email VM 1” from 1 to 2:
get-vm “Email VM 1 User N” | `
set-vm –numcpu 2

Read the last 10 lines of the hostd log file from ESX1:
(get-log –host (get-vmhost esx1) `
hostd).Entries[-10..-1]

Identify which VMs have network adapters that are not automatically connected:
get-vm | where { `
$_ | get-networkadapter | where { `
$_.ConnectionState.StartConnected -eq 0 `
} `
}

Cool stuff!

Tools Tools Tools

Duncan Epping · Mar 6, 2008 ·

For anyone using the good old Winscp client, it was just updated to 4.0.7. Same goes for mRemote, it has just been updated to version 1.35. Pick it up, and while your at it visit VM4All. Eric keeps track of all VMware related tools!

esx-autopatch.pl

Duncan Epping · Mar 2, 2008 ·

For all those not using the VirtualCenter Update Manager, Dominic uploaded an update on his esx-autopatch.pl script. You can now also patch 3.5 hosts with this script, which can come in handy for scripted installs!

Selective VCB fullvm images

Duncan Epping · Feb 18, 2008 ·

During the VMware course DSA I discovered that it is in fact possible to dump specific vmdk’s with the use of the default VCB tools. While I was finding out a way to script this I was notified in one of my blogs by JTurver(Justin Turver) that he already wrote a script that could do what I was looking for. It’s a great script for dumping all system disks and leaving the disk that are filled with data alone. You can use a text file as input for the vbs script. Check out his blog on the VMware website! Great work and thanks for pointing me out!

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 40
  • Page 41
  • Page 42
  • Page 43
  • Page 44
  • Go to Next Page »

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in