title: PowerShell: Confirming Connection to Servers and choosing to continue script
body: <p>Good Afternoon,</p>
  <p>I'm working on a small line of code to have run at the beginning on a script to test the connection to my servers giving the option to continue running the script if some connections cannot be made. I'm having some troubles sorting out how it should be formatted.
  NOTE: I do know the <code>| -write-output</code> section is wrong but its there to kind of show what I'm wanting.</p>
  <pre><code>
  Foreach ($Server in $Servers){
      if(Test-Connection $Server -count 2 -Quiet) {
          write-host &quot;$server is available&quot; -foregroundcolor green
          } else { 
              write-host &quot;$server cannot be reached&quot; -foregroundcolor Red | Write-output $noconnection
                      }
      }
  
  If ($noconnection -eq $true) {$continue = read-host &quot;A connection couldn't be made to all the servers, do you wish to continue? [y/n]&quot;}
  If ($continue -eq &quot;n&quot;) {Write-host &quot;cancelling script&quot;}
  </code></pre>