Update some check-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2023-01-23 14:04:23 +01:00
parent fbd44c0c28
commit 34d6adef57
11 changed files with 35 additions and 34 deletions

View File

@ -18,7 +18,7 @@ try {
$BootTime = Get-WinEvent -ProviderName eventlog | Where-Object {$_.Id -eq 6005} | Select-Object TimeCreated -First 1
$Uptime = New-TimeSpan -Start $BootTime.TimeCreated.Date -End (Get-Date)
}
$Reply = "Up for "
$Reply = "Up for "
$Days = $Uptime.Days
if ($Days -eq "1") {
$Reply += "1 day, "
@ -39,7 +39,7 @@ try {
} else {
$Reply += "$Minutes minutes"
}
Write-Host "$Reply."
Write-Host $Reply
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"