This commit is contained in:
ofilter
2022-04-05 23:27:54 +02:00
parent 393d025b14
commit 1a72313e20
2 changed files with 24 additions and 6 deletions

View File

@ -32,7 +32,6 @@ host2 host3"
$HYPERV_ARRAY=@()
# $i=0
foreach ($url in $HYPERV_LIST)
{
if ($url)
@ -40,16 +39,16 @@ host2 host3"
[HypervServer]$new_hyerv=[HypervServer]::new()
$new_hyerv.URL=$url
$HYPERV_ARRAY+=$new_hyerv
# $i++
}
}
return $HYPERV_ARRAY
}
function Check-Hyperv-Servers($hv_arr) {
function Check-Access($hv_arr) {
foreach ($connection in $hv_arr)
{
$connection.cla
Invoke-Command -ComputerName $connection.URL | out-null
$connection.Authenticated=$?
}
}
@ -61,10 +60,11 @@ function Print-Connections-Status($vs_arr) {
}
$hyperv_arr=Get-Hyperv
Check-Access($hv_arr)
#$hyperv_arr.GetType()
Print-Connections-Status($hyperv_arr)
#echo "1"