Hi,
I have a question regarding executing custom PS Scripts via SCCM. I am trying run a PowerShell script via task sequence by invoking through command line.
%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File C:\users\public\PersonalTemplates.ps1 -CurrentUser
I am trying to amend an entry in HKCU via script. The task sequence suggests it ended successfully. The script returns with code 0 but it doesn't modify/amend the value in the registry. Instead, I get the following error in the smsts.log:
RegQueryValueExW is unsuccessful for Software\Microsoft\SMS\Task Sequence, SMSTSEndProgram TSManager 13936 (0x3670)
GetTsRegValue() is unsuccessful. 0x80070002. TSManager 13936 (0x3670)
I have even tried the sysnative path suggestion but it fails to find that path (as I believe it doesn't exist) All our clients machines are 64 bit Windows 10 systems
When the script is run manually on a machine, it works absolutely fine.
Please advise what am I doing wrong
Regards.