|
|
@@ -5,6 +5,7 @@ param(
|
|
|
|
|
|
$Date = Get-Date
|
|
|
|
|
|
+mkdir -Force ".\logs" | Out-Null
|
|
|
$logfile = ".\logs\Monitor_http_{0}-{1}-{2}.log" -f ($Date.Year,$Date.Month,$Date.Day)
|
|
|
|
|
|
Function main(){
|
|
|
@@ -19,7 +20,7 @@ try {
|
|
|
$success = $false
|
|
|
}
|
|
|
|
|
|
-if ((-not $success) -and $Response.StatusCode -ne 200){
|
|
|
+if ((-not $success) -or $Response.StatusCode -ne 200){
|
|
|
"Stopping Service ${ServiceName}"
|
|
|
net stop $ServiceName
|
|
|
"Stopped Service ${ServiceName}"
|