mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-30 21:54:43 +02:00
Updaate check-operating-system.ps1
This commit is contained in:
parent
9f396620df
commit
844996442b
@ -17,13 +17,15 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
$OS = Get-WmiObject -class Win32_OperatingSystem
|
$OS = Get-WmiObject -class Win32_OperatingSystem
|
||||||
$Name = $OS.Caption
|
$Name = $OS.Caption
|
||||||
$Architecture = $OS.OSArchitecture
|
$Arch = $OS.OSArchitecture
|
||||||
$Version = $OS.Version
|
$Version = $OS.Version
|
||||||
|
|
||||||
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
|
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
|
||||||
$OSDetails = Get-CimInstance Win32_OperatingSystem
|
$OSDetails = Get-CimInstance Win32_OperatingSystem
|
||||||
|
$BuildNo = $OSDetails.BuildNumber
|
||||||
|
$Serial = $OSDetails.SerialNumber
|
||||||
$InstallDate = $OSDetails.InstallDate
|
$InstallDate = $OSDetails.InstallDate
|
||||||
"✅ $Name ($Architecture) v$Version, installed $($InstallDate.ToShortDateString())"
|
"✅ $Name ($Arch, v$Version, serial $Serial), installed $($InstallDate.ToShortDateString())."
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user