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) {
|
} elseif ($Used -lt $Free) {
|
||||||
"✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)"
|
"✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)"
|
||||||
} else {
|
} else {
|
||||||
"✅ Drive $ID has $(Bytes2String $Free) of $(Bytes2String $Total) left to use"
|
"✅ Drive $ID has $(Bytes2String $Free) free of $(Bytes2String $Total)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
& "$PSScriptRoot/check-battery.ps1"
|
& "$PSScriptRoot/check-battery.ps1"
|
||||||
" "
|
" "
|
||||||
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
|
& "$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-uptime.ps1"
|
||||||
& "$PSScriptRoot/check-time-zone.ps1"
|
& "$PSScriptRoot/check-time-zone.ps1"
|
||||||
& "$PSScriptRoot/check-swap-space.ps1"
|
& "$PSScriptRoot/check-swap-space.ps1"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script queries and lists operating system details.
|
This PowerShell script queries and lists operating system details.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-operating-system
|
PS> ./check-os
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -25,7 +25,7 @@ try {
|
|||||||
$BuildNo = $OSDetails.BuildNumber
|
$BuildNo = $OSDetails.BuildNumber
|
||||||
$Serial = $OSDetails.SerialNumber
|
$Serial = $OSDetails.SerialNumber
|
||||||
$InstallDate = $OSDetails.InstallDate
|
$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
|
exit 0 # success
|
||||||
} catch {
|
} 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