Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

how to continually check an array until all values are the same in the array

$
0
0

Hello,

I have an array and I would like to keep looping through it until all values contained in the array are true, but i am unsure how to construct this.

this is what i have

$AllISCSIConnected = $false

#loop through the targets until they are all giving a status of IsConnected = true

$IsConnectedArray = Get-IscsiTarget | Select -ExpandProperty IsConnected

the $IsConnectedArray will contain a mix of True and False, I would like it to sleep for a while, set the array to null, then re-populate it with the latest values and re-evaluate. when all values are True then set the $AllISCSIConnected variable to true to leave the loop (if that helps, unless there is another way?)

thanks

Steve


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>