Hi @Razzi29 ,
maybe this helps to get started:
$urls = "https://www.google.deu" , "www.google.com", "www.microsoft.com"
$resultFile = "result.txt"
$urls | ForEach-Object { $result = ""
$result = Invoke-WebRequest -Uri $_
if (($result.StatusCode) -eq 200) {
Write-Output "Hurray"
Out-File -FilePath $resultFile -Encoding utf8 -Append -InputObject "$_ test sucess"
Start-Sleep 10
}
else {
Write-Output "Oh nooooo .... Do something else"
Out-File -FilePath $resultFile -Encoding utf8 -Append -InputObject "$_ test failed"
}
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten