mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-08 20:54:38 +02:00
Updated some check-*.ps1 scripts
This commit is contained in:
@ -15,7 +15,7 @@ try {
|
||||
if ($IsLinux) {
|
||||
$Name = $PSVersionTable.OS
|
||||
if ([System.Environment]::Is64BitOperatingSystem) { $Bits = "64-bit" } else { $Bits = "32-bit" }
|
||||
"✅ $Name ($Bits)"
|
||||
Write-Host "✅ $Name ($Bits)"
|
||||
} else {
|
||||
$OS = Get-WmiObject -class Win32_OperatingSystem
|
||||
$Name = $OS.Caption -Replace "Microsoft Windows","Windows"
|
||||
@ -29,10 +29,10 @@ try {
|
||||
$InstallDate = $OSDetails.InstallDate
|
||||
|
||||
$ProductKey = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" -Name BackupProductKeyDefault).BackupProductKeyDefault
|
||||
"✅ $Name ($Arch, v$Version, S/N $Serial, P/K $ProductKey) since $($InstallDate.ToShortDateString())"
|
||||
Write-Host "✅ $Name ($Arch, v$Version, S/N $Serial, P/K $ProductKey) since $($InstallDate.ToShortDateString())"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user