mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-15 11:10:54 +01:00
Update check-powershell.ps1
This commit is contained in:
parent
e1e301ebc7
commit
9b8bd116e6
@ -5,7 +5,7 @@
|
||||
This PowerShell script queries the PowerShell status and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-powershell
|
||||
✅ PowerShell 5.1.19041.2673 Desktop edition (10 modules, 1458 cmdlets, 172 aliases)
|
||||
✅ PowerShell Desktop edition 5.1.19041.2673 (10 modules, 1458 cmdlets, 172 aliases)
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -18,14 +18,13 @@ try {
|
||||
$NumModules = (Get-Module).Count
|
||||
$NumAliases = (Get-Alias).Count
|
||||
if ($IsLinux) {
|
||||
$Reply = "✅ PowerShell $Version $Edition edition ($NumModules modules, $NumAliases aliases)"
|
||||
"✅ PowerShell $Edition edition $Version ($NumModules modules, $NumAliases aliases)"
|
||||
} else {
|
||||
$NumCmdlets = (Get-Command -Command-Type cmdlet).Count
|
||||
$Reply = "✅ PowerShell $Version $Edition edition ($NumModules modules, $NumCmdlets cmdlets, $NumAliases aliases)"
|
||||
"✅ PowerShell $Edition edition $Version ($NumModules modules, $NumCmdlets cmdlets, $NumAliases aliases)"
|
||||
}
|
||||
Write-Host $Reply
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user