diff --git a/Scripts/check-drives.ps1 b/Scripts/check-drives.ps1 index 653e62fb..2834004f 100755 --- a/Scripts/check-drives.ps1 +++ b/Scripts/check-drives.ps1 @@ -47,7 +47,7 @@ try { } elseif ($Used -lt $Free) { "✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)" } else { - "✅ Drive $ID has $(Bytes2String $Free) of $(Bytes2String $Total) left to use" + "✅ Drive $ID has $(Bytes2String $Free) free of $(Bytes2String $Total)" } } exit 0 # success diff --git a/Scripts/check-health.ps1 b/Scripts/check-health.ps1 index 372c280d..33e57f46 100755 --- a/Scripts/check-health.ps1 +++ b/Scripts/check-health.ps1 @@ -22,7 +22,8 @@ & "$PSScriptRoot/check-battery.ps1" " " & "$PSScriptRoot/write-green.ps1" " S O F T W A R E" -& "$PSScriptRoot/check-operating-system.ps1" +& "$PSScriptRoot/check-os.ps1" +& "$PSScriptRoot/check-powershell.ps1" & "$PSScriptRoot/check-uptime.ps1" & "$PSScriptRoot/check-time-zone.ps1" & "$PSScriptRoot/check-swap-space.ps1" diff --git a/Scripts/check-operating-system.ps1 b/Scripts/check-os.ps1 similarity index 86% rename from Scripts/check-operating-system.ps1 rename to Scripts/check-os.ps1 index 2bab943c..8676d77b 100755 --- a/Scripts/check-operating-system.ps1 +++ b/Scripts/check-os.ps1 @@ -4,7 +4,7 @@ .DESCRIPTION This PowerShell script queries and lists operating system details. .EXAMPLE - PS> ./check-operating-system + PS> ./check-os .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -25,7 +25,7 @@ try { $BuildNo = $OSDetails.BuildNumber $Serial = $OSDetails.SerialNumber $InstallDate = $OSDetails.InstallDate - "✅ $($Name): $Arch, v$Version, S/N $Serial, installed $($InstallDate.ToShortDateString())" + "✅ $($Name) ($Arch, v$Version, S/N $Serial, installed $($InstallDate.ToShortDateString()))" } exit 0 # success } catch { diff --git a/Scripts/check-powershell.ps1 b/Scripts/check-powershell.ps1 new file mode 100644 index 00000000..766966eb --- /dev/null +++ b/Scripts/check-powershell.ps1 @@ -0,0 +1,22 @@ +<# +.SYNOPSIS + Query PowerShell details +.DESCRIPTION + This PowerShell script queries and lists details of PowerShell. +.EXAMPLE + PS> ./check-powershell +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + $Version = $PSVersionTable.PSVersion + $Edition = $PSVersionTable.PSEdition + "✅ PowerShell $Version ($Edition edition)" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} \ No newline at end of file