Created
June 8, 2020 17:29
-
-
Save billkindle/6923e7b823c7384aee4555bea5daa024 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Any URL you want to test | |
$url = 'https://www.google.com' | |
# This will gather everything but that's OK | |
$http = (Invoke-WebRequest -Uri $url) | |
# I'm using the $http object membertype property to get the status code | |
Write-Output $http.StatusCode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pester test being run from another system invokes this script and reads the output. The test is expecting 200, but this way if any other status code is found, I'll at least see that output in my test results.