File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1016,16 +1016,13 @@ 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+ $osEditionRaw = ' Unknown'
1020+ if ($os.Caption -match ' \bHome\b' ) { $osEditionRaw = ' Home' }
1021+ elseif ($os.Caption -match ' \bPro\b' ) { $osEditionRaw = ' Pro' }
1022+ elseif ($os.Caption -match ' \bEnterprise\b' ) { $osEditionRaw = ' Enterprise' }
1023+ elseif ($os.Caption -match ' \bEducation\b' ) { $osEditionRaw = ' Education' }
1024+ elseif ($os.Caption -match ' \bServer\b' ) { $osEditionRaw = ' Server' }
1025+ $osEdition = ConvertTo-HtmlSafe $osEditionRaw
10291026 $osBuild = $script :OsBuild
10301027 $ramGB = [math ]::Round($os.TotalVisibleMemorySize / 1 MB , 1 )
10311028 $uptimeHrs = [math ]::Round(((Get-Date ) - $os.LastBootUpTime ).TotalHours, 1 )
You can’t perform that action at this time.
0 commit comments