I’m imaging devices, and trying to output the results of Invoke-GPUpdate to a file.
I’m using the following command in an SCCM Task Sequence:
powershell.exe -ExecutionPolicy Bypass -File .Invoke-GPUpdate.ps1 | Out-File -FilePath C:TempInvoke-GPUpdate.log -Append
If I run that command in Windows, the Invoke-GPUpdate.log is created.
When run in SCCM, there is no log. The PowerShell script is basic:
If I move the Out-File into the script, like below, the file is created, but there is no data in it:
Invoke-GPUpdate -Force | Out-File -FilePath C:TempInvoke-GPUpdate.log
I can see data returned in ISE, but it’s not being translated into the file.