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" }
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" }