$Shelltimeout = Get-VMHost | Select Name, @{N="settings";E={(Get-VMHostAdvancedConfiguration-vmhost $_ -name UserVars.ESXiShellTimeOut).values}}
$myItem.Shelltimeout = $Shelltimeout.settings
this doesnt seem to work. i keep getting blank in the csv file. On the Powershell connamd line, if i do a write-host $shelltimeout[0].settings, i get an output, but $Shelltimeout.settings is blank. i am using this within a foreach loop
foreach ($vmhin$vmhs) { $myItem="" | SelectVC , Host , Shelltimeout $myItem.Host=$vmh.Name $myItem.VC=$vc $myItem.Version=$vmh.Version Connect-VIServer$vmh.Name-Credential$rcred $Shelltimeout= Get-VMHost | Select Name, @{N="settings";E={(Get-VMHostAdvancedConfiguration -vmhost $_ -name UserVars.ESXiShellTimeOut).values}} $myItem.Shelltimeout = $Shellto.settings Disconnect-VIServer-Server*-Confirm:$false $HostData+=$myItem } }
how do i specify the arraynumber?
thanks in advance for you help!!