How to use hash table with Powercli

Hash table is a data structure where we can store our data.Comparing to the data arrays in powercli/powershell , the main difference is with hash table we can easily handle multiple type of data such as Integer,String,etc..

Some times we need to generate reports using some of the PowerShell commands(export-csv,out-file,add-content).With below example my requirement is to generate vm report which include VMname,Datastore name,Network port group and vmawre tools status.But to gather all the information we have to use multiple get commands and then its difficult to consolidate this data.Hash table was helped me on this.I can gather values from multiple commands and assign to hash table.I have highlghted hash table related commands in my script.

import-module vmware.vimautomation.ha

connect-viserver vcsa.corp.local


foreach ($vm in $vms)

     $dstore=get-vm $|get-datastore
     $nicport=(get-vm $
     $vmtools=(get-vm $


$result+=new-object psobject -property $properties
$result|select name,datastore,network,vmwaretools|export-csv d:\mycsv.csv -append -notypeinformation

vRealize Orchestrator how to restart management agent of esx host

Login to the vRealize Orchestrator client


Select the workflow view> Expand library


There are some predefined workorders in these folders.Under SSH foder there is workorder to run SSH command Continue reading “vRealize Orchestrator how to restart management agent of esx host”