Split Array based on Test-Connection
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Split Array based on Test-Connection
I resolved the issue, there was an error with how my script was passing the variables. Thanks for all of your help!
Re: Split Array based on Test-Connection
The folloing line:
$HostList += HostName
should be:
$HostList += $env:COMPUTERNAME
Why use a system utility function when PowerShell provides the correct string.
$HostList += HostName
should be:
$HostList += $env:COMPUTERNAME
Why use a system utility function when PowerShell provides the correct string.
Re: Split Array based on Test-Connection
Again. You do not need arraylist. THe following line creates a correct array.
$hostlist = Get-Content comuters.txt