Skip to content

Commit 58ccaba

Browse files
authored
Optimize osEdition assignment and remove update date
Removed unnecessary line about update date and optimized the osEdition assignment.
1 parent 238f779 commit 58ccaba

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

DeployWorkstation.ps1

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DeployWorkstation.ps1 – Optimized Win10/11 Setup & Clean-up
2-
# Version: 5.1 – PNWC Edition *Updated 3-31-2026
2+
# Version: 5.1 – PNWC Edition
33
# New in 5.0: Write-Progress console bars, embedded en-US / es-ES localization
44
# New in 5.1: Winget auto-bootstrap, install retry logic, WU guard, OEM OneDrive, edition awareness
55

@@ -1016,16 +1016,15 @@ function Export-HtmlReport {
10161016
$os = Get-CimInstance Win32_OperatingSystem
10171017
$cpu = ConvertTo-HtmlSafe (Get-CimInstance Win32_Processor | Select-Object -First 1).Name
10181018
$osCaption = ConvertTo-HtmlSafe $os.Caption
1019-
$osEdition = ConvertTo-HtmlSafe (
1020-
switch -Regex ($os.Caption) {
1021-
'\bHome\b' { 'Home' }
1022-
'\bPro\b' { 'Pro' }
1023-
'\bEnterprise\b' { 'Enterprise' }
1024-
'\bEducation\b' { 'Education' }
1025-
'\bServer\b' { 'Server' }
1026-
default { 'Unknown' }
1027-
}
1028-
)
1019+
$editionRaw = switch -Regex ($os.Caption) {
1020+
'\bHome\b' { 'Home' }
1021+
'\bPro\b' { 'Pro' }
1022+
'\bEnterprise\b' { 'Enterprise' }
1023+
'\bEducation\b' { 'Education' }
1024+
'\bServer\b' { 'Server' }
1025+
default { 'Unknown' }
1026+
}
1027+
$osEdition = ConvertTo-HtmlSafe $editionRaw
10291028
$osBuild = $script:OsBuild
10301029
$ramGB = [math]::Round($os.TotalVisibleMemorySize / 1MB, 1)
10311030
$uptimeHrs = [math]::Round(((Get-Date) - $os.LastBootUpTime).TotalHours, 1)

0 commit comments

Comments
 (0)