|
|
@@ -19,7 +19,7 @@ try {
|
|
|
$success = $false
|
|
|
}
|
|
|
|
|
|
-if ($success -and $Response.StatusCode -ne 200){
|
|
|
+if ((-not $success) -and $Response.StatusCode -ne 200){
|
|
|
"Stopping Service ${ServiceName}"
|
|
|
net stop $ServiceName
|
|
|
"Stopped Service ${ServiceName}"
|
|
|
@@ -33,7 +33,7 @@ if ($success -and $Response.StatusCode -ne 200){
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- main >> $logfile
|
|
|
+ main | Tee-Object $logfile -Append
|
|
|
} catch {
|
|
|
- $_.exception >> $logfile
|
|
|
+ $_.exception | Tee-Object $logfile -Append
|
|
|
}
|