Tuesday 15 May 2012

vCLI (vSphere PowerShell) Primer

Connect-VIServer -Server vsphere_vCenter
vihostupdate –server HOSTNAME –install –bundle c:\folder\name_of_file.zip

to install drivers, etc. but host needs to be in maint mode

get-vm | Get-CDDrive | select @{'n' = 'Name'; 'e' = { $_.Parent.Name} }, @{'n' = 'IsConnected'; 'e' = {$_.ConnectionState.Connected}}, @{'n' = "ISOFile"; 'e' = {$_.ISOPath}} | where {$_.IsConnected}

write-output "disconnecting Idle vCenter session connnections"

(following examples used by ESX5 Deployment Tool)
PowerCLI> Get-DeployRuleSet
PowerCLI> Get-VMHost vh1t.mits.apmn.org | Get-VMHostAttributes

M$ PowerShell:

No comments:

Post a Comment