Carter Shanklin explains a great new feature of the official 1.0 release of the VI Toolkit here:
http://blogs.vmware.com/vipowershell/2008/08/keeping-it-simp.html

This should make your scripts (the ones created for the beta release) a lot shorter!

New-VM -vmHost (Get-VMHost $VMHostName) -datastore (Get-Datastore $DatastoreName) -network (Get-Network $NetworkName)

or:

$VMHost = Get-VMHost $VMHostName
$Datastore = Get-Datastore $DatastoreName
$Network = Get-Network $NetworkName
New-VM -VMHost $VMHost -Datastore $Datastore -Network $Network

becomes:

New-VM -VMHost $VMHostName -Datastore $DatastoreName -Network $NetworkName

Nice!

»crosslinked«

Related posts:

  1. Calculate vSphere 5 Licenses with Powershell (UPDATED)
  2. Remove vmware memory limits with Powershell

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2012 PeetersOnline Suffusion theme by Sayontan Sinha