MSEndpointMgr / ModernBIOSManagement

MIT License
45 stars 22 forks source link

Detects TS is running in WinPE when it's not #2

Closed Ginolard closed 3 years ago

Ginolard commented 3 years ago

I noticed that you've changed the detection method for OSDDownloadContent.exe in this version but it does not work. When running this version in a TS in FullOS it must have detected _SMSTSInWinPE as $True because the logfile contained the line "Starting package content download process (WinPE), this might take some time"

I think it would be better to revert to the old method of checking for the presence of C:\windows\ccm\osddownloadcontent.exe

if ($TSEnvironment.Value("_SMSTSInWinPE") -eq $false) { Write-CMLogEntry -Value " - Starting package content download process (FullOS), this might take some time" -Severity 1 $ReturnCode = Invoke-Executable -FilePath (Join-Path -Path $env:windir -ChildPath "CCM\OSDDownloadContent.exe") } else { Write-CMLogEntry -Value " - Starting package content download process (WinPE), this might take some time" -Severity 1 $ReturnCode = Invoke-Executable -FilePath "OSDDownloadContent.exe" }

Ginolard commented 3 years ago

Never mind - found the issue