Update check-os.ps1 and check-powershell.ps1

This commit is contained in:
Markus Fleschutz 2022-12-02 08:41:01 +01:00
parent aa593c5edc
commit 365c53c13e
2 changed files with 5 additions and 4 deletions

View File

@ -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 {

View File

@ -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])"