mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-15 10:28:55 +01:00
Add check-powershell.ps1
This commit is contained in:
parent
546dbdfcaf
commit
0fe4d2f6c7
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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 {
|
22
Scripts/check-powershell.ps1
Normal file
22
Scripts/check-powershell.ps1
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user