mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-28 23:56:52 +01:00
Add unicode characters
This commit is contained in:
parent
f43dc498e4
commit
46f7fd7b9c
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-cpu-temp.ps1
|
.SYNTAX check-cpu-temp.ps1
|
||||||
.DESCRIPTION checks the CPU temperature
|
.DESCRIPTION checks the CPU temperature
|
||||||
@ -26,7 +26,7 @@ try {
|
|||||||
} elseif ($Temp -lt "0") {
|
} elseif ($Temp -lt "0") {
|
||||||
write-warning "$Temp °C CPU temperature is quite low"
|
write-warning "$Temp °C CPU temperature is quite low"
|
||||||
} else {
|
} else {
|
||||||
write-host -foregroundColor green "OK - $Temp °C CPU temperature"
|
write-host -foregroundColor green "✔️ $Temp °C CPU temperature"
|
||||||
}
|
}
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-dns-resolution.ps1
|
.SYNTAX check-dns-resolution.ps1
|
||||||
.DESCRIPTION checks the DNS resolution with frequently used domain names
|
.DESCRIPTION checks the DNS resolution with frequently used domain names
|
||||||
@ -25,7 +25,7 @@ try {
|
|||||||
|
|
||||||
$Elapsed = $StopWatch.Elapsed
|
$Elapsed = $StopWatch.Elapsed
|
||||||
$Average = [math]::round($Count / $Elapsed.Seconds, 1)
|
$Average = [math]::round($Count / $Elapsed.Seconds, 1)
|
||||||
write-host -foregroundColor green "OK - $Average domains/s ($Count domains resolved in $($Elapsed.Seconds) seconds)"
|
write-host -foregroundColor green "✔️ $Average domains/s ($Count domains resolved in $($Elapsed.Seconds) seconds)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-drive-space.ps1 [<drive>] [<min-level>]
|
.SYNTAX check-drive-space.ps1 [<drive>] [<min-level>]
|
||||||
.DESCRIPTION checks the given drive for free space left
|
.DESCRIPTION checks the given drive for free space left
|
||||||
@ -22,7 +22,7 @@ try {
|
|||||||
write-warning "Drive $Drive has only $Free GB left to use! ($Used GB out of $Total GB in use, minimum is $MinLevel GB)"
|
write-warning "Drive $Drive has only $Free GB left to use! ($Used GB out of $Total GB in use, minimum is $MinLevel GB)"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
write-host -foregroundColor green "OK - $Free GB left on drive $Drive ($Used GB of $Total GB used)"
|
write-host -foregroundColor green "✔️ $Free GB left on drive $Drive ($Used GB of $Total GB used)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-file-system.ps1 [<drive>]
|
.SYNTAX check-file-system.ps1 [<drive>]
|
||||||
.DESCRIPTION checks the validity of the file system (needs admin rights)
|
.DESCRIPTION checks the validity of the file system (needs admin rights)
|
||||||
@ -18,7 +18,7 @@ try {
|
|||||||
$Result = repair-volume -driveLetter $Drive -scan
|
$Result = repair-volume -driveLetter $Drive -scan
|
||||||
if ($Result -ne "NoErrorsFound") { throw "'repair-volume' failed" }
|
if ($Result -ne "NoErrorsFound") { throw "'repair-volume' failed" }
|
||||||
|
|
||||||
write-host -foregroundColor green "OK - file system on drive $Drive is clean"
|
write-host -foregroundColor green "✔️ file system on drive $Drive is clean"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-health.ps1
|
.SYNTAX check-health.ps1
|
||||||
.DESCRIPTION checks the health of the local computer
|
.DESCRIPTION checks the health of the local computer
|
||||||
@ -31,7 +31,7 @@ if ($lastExitCode -ne "0") { $Healthy = 0 }
|
|||||||
if ($lastExitCode -ne "0") { $Healthy = 0 }
|
if ($lastExitCode -ne "0") { $Healthy = 0 }
|
||||||
|
|
||||||
if ($Healthy) {
|
if ($Healthy) {
|
||||||
write-host -foregroundColor green "OK - $Hostname is healthy"
|
write-host -foregroundColor green "✔️ $Hostname is healthy"
|
||||||
exit 0
|
exit 0
|
||||||
} else {
|
} else {
|
||||||
write-warning "$Hostname is NOT healthy"
|
write-warning "$Hostname is NOT healthy"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-ping.ps1
|
.SYNTAX check-ping.ps1
|
||||||
.DESCRIPTION checks the ping latency to the internet
|
.DESCRIPTION checks the ping latency to the internet
|
||||||
@ -25,7 +25,7 @@ try {
|
|||||||
}
|
}
|
||||||
$Avg = $Avg / $Pings.count
|
$Avg = $Avg / $Pings.count
|
||||||
|
|
||||||
write-host -foregroundColor green "OK - $Avg ms average ping latency ($Min ms min, $Max ms max)"
|
write-host -foregroundColor green "✔️ $Avg ms average ping latency ($Min ms min, $Max ms max)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-swap-space.ps1 [<min-level>]
|
.SYNTAX check-swap-space.ps1 [<min-level>]
|
||||||
.DESCRIPTION checks the free swap space
|
.DESCRIPTION checks the free swap space
|
||||||
@ -31,7 +31,7 @@ try {
|
|||||||
write-warning "Swap space has only $Free GB left to use! ($Used GB out of $Total GB in use, minimum is $MinLevel GB)"
|
write-warning "Swap space has only $Free GB left to use! ($Used GB out of $Total GB in use, minimum is $MinLevel GB)"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
write-host -foregroundColor green "OK - $Free GB left on swap space ($Used GB of $Total GB used)"
|
write-host -foregroundColor green "✔️ $Free GB left on swap space ($Used GB of $Total GB used)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/pwsh
|
#!/usr/bin/pwsh
|
||||||
<#
|
<#
|
||||||
.SYNTAX check-windows-system-files.ps1
|
.SYNTAX check-windows-system-files.ps1
|
||||||
.DESCRIPTION checks the validity of the Windows system files (requires admin rights)
|
.DESCRIPTION checks the validity of the Windows system files (requires admin rights)
|
||||||
@ -12,7 +12,7 @@ try {
|
|||||||
sfc /verifyOnly
|
sfc /verifyOnly
|
||||||
if ($lastExitCode -ne "0") { throw "'sfc /verifyOnly' failed" }
|
if ($lastExitCode -ne "0") { throw "'sfc /verifyOnly' failed" }
|
||||||
|
|
||||||
write-host -foregroundColor green "OK - Windows system files have been checked"
|
write-host -foregroundColor green "✔️ checked Windows system files"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -28,7 +28,7 @@ try {
|
|||||||
$Count++
|
$Count++
|
||||||
}
|
}
|
||||||
|
|
||||||
write-host -foregroundColor green "✅ fetched updates for $Count Git repositories under $ParentDir in $($StopWatch.Elapsed.Seconds) second(s)"
|
write-host -foregroundColor green "✔️ fetched updates for $Count Git repositories under $ParentDir in $($StopWatch.Elapsed.Seconds) second(s)"
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# My PowerShell Profile
|
# My PowerShell Profile
|
||||||
# =====================
|
# =====================
|
||||||
# Welcome to 'my-profile.ps1' - this file defines the look & feel of PowerShell.
|
# Welcome to 'my-profile.ps1' - this file defines the look & feel of PowerShell.
|
||||||
# Comment, uncomment or adapt the following lines to your needs, please.
|
# Comment, uncomment or adapt the following lines to your needs, please.
|
||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
# My Welcome Message
|
# My Welcome Message
|
||||||
# ------------------
|
# ------------------
|
||||||
write-host "+++ Welcome to PowerShell $($PSVersionTable.PSVersion) at $(hostname), it's $(Get-date) +++"
|
write-host "❤️ Welcome to PowerShell $($PSVersionTable.PSVersion) at $(hostname), it's $(Get-date) ❤️"
|
||||||
write-host ""
|
write-host ""
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user