mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-03 05:31:03 +02:00
Update check-os.ps1 and check-powershell.ps1
This commit is contained in:
parent
aa593c5edc
commit
365c53c13e
@ -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 on $($InstallDate.ToShortDateString())"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
try {
|
try {
|
||||||
$Version = $PSVersionTable.PSVersion
|
$Version = $PSVersionTable.PSVersion
|
||||||
$Edition = $PSVersionTable.PSEdition
|
$Edition = $PSVersionTable.PSEdition
|
||||||
$Modules = Get-Module
|
$NumModules = (Get-Module).Count
|
||||||
$Aliases = Get-Alias
|
$NumCmdlets = (Get-Command -Command-Type cmdlet).Count
|
||||||
"✅ PowerShell $Version ($Edition edition) with $($Modules.Count) modules and $($Aliases.Count) aliases"
|
$NumAliases = (Get-Alias).Count
|
||||||
|
"✅ PowerShell $Version ($Edition edition) with $NumModules modules, $NumCmdlets cmdlets and $NumAliases aliases"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user