The Desktop Update Agent has been enhanced to allow an administrator to run both "pre" and "post" PowerShell scripts on end-user workstations. Here are some additional considerations to use this new feature:
1.) The 32-bit version of PowerShell, PowerShell (x86), will need to have its execution policy set appropriately on the end-user workstations that will be running DUA. By default, DUA will attempt to run a built in PowerShell script called "DetectDomainJoined.ps1", which will detect if the workstation is domain joined. The "DetectDomainJoined.ps1" script is signed by Quest and will require that the PowerShell (x86) execution policy be set to either "RemoteSigned" or "Unrestricted". If DUA is unable to run the "DetectDomainJoined.ps1" script due to an execution policy that is too restrictive, then DUA will not attempt to run any further PowerShell scripts. If you set the PowerShell (x86) execution policy to "RemoteSigned", then you will need to sign your own custom scripts for them to be ran successfully. Another option is to set the PowerShell (x86) execution policy to "Unrestricted". However, this will allow the workstation to run any PowerShell script, which may have security implications.
Please refer to this Microsoft KB article about the available PowerShell execution policy options:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.3Please refer to this Microsoft KB article about signing your own custom scripts:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-7.3
2.) DUA does install with sample "pre" and "post" scripts. These scripts provide "proof of concept", which will create two log files "quest.sample.pre.out.txt" and "quest.sample.post.out.txt" in the user temp directory here:
C:\Users\<user>\AppData\Local\Temp
If you add your own custom script to either the "PreScript" or "PostScript" directory, then the built-in sample scripts will be ignored and will not run.
See this
On Demand Migration - PowerShell with DUA - New Feature Spotlight post in the Quest communities for additional details on running PowerShell Scripts with DUA.