我试图从两个单独的命令中获取两个属性并将它们添加到一个变量中以便能够进一步评估。有人告诉我自定义对象可以工作...
Clear-Host
Add-PSSnapin citrix* -ErrorAction SilentlyContinue
$DRSrvs = Get-XAServer drptsw00* | select -ExpandProperty servername
$hash = $null
$hash = @{}
foreach ($DR in $DRSrvs) {
$hash = New-Object PsObject -Property @{
servername = $DR
Logins = (Get-XALoadEvaluator -ServerName $DR).LoadEvaluatorName
}
}