PowerShell-Skript zum Überprüfen des Status einer URL
Ähnlich dieser Frage hier Ich versuche zu überwachen, ob eine Reihe von Website-Links aktiv sind oder nicht reagieren. Ich habe das gleiche PowerShell-Skript über das Internet gefunden.
Anstelle von direkten Website-Links muss ich jedoch spezifischere Links überprüfen, zum Beispiel:
http://mypage.global/Chemical/
http://maypage2:9080/portal/site/hotpot/
Wenn ich versuche, den Status dieser Links zu überprüfen, erhalte ich die folgende Ausgabe:
URL StatusCode StatusDescription ResponseLength TimeTaken
http://mypage.global/Chemical/ 0
http://maypage2:9080/portal/site/hotpot/ 0
Die obigen Links setzen voraus, dass ich mit dem VPN verbunden bin, aber ich kann über den Browser auf diese Links zugreifen.
Ausgabe vonInvoke-WebRequest -Uri https://stackoverflow.com/questions/20259251/powershell-script-to-check-the-status-of-a-url
:
PS C:\Users\682126> Invoke-WebRequest -Uri https://stackoverflow.com/questions/20259251/powershell-script-to-check-the-status-of-a-url
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<< -Uri https://stackoverflow.com/questions/20259251/powershell-script-to-check-the-status-of-a-url > tmp.txt
+ CategoryInfo : ObjectNotFound: (Invoke-WebRequest:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
$PSVersionTable
Name Value
---- -----
CLRVersion 2.0.50727.5472
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1