feat: let admins choose the PowerShell engine for script tasks - #487
Open
mirbach wants to merge 1 commit into
Open
feat: let admins choose the PowerShell engine for script tasks#487mirbach wants to merge 1 commit into
mirbach wants to merge 1 commit into
Conversation
Adds a dropdown to the PowerShell task form (Windows PowerShell 5.1 / PowerShell 7+ (pwsh) / Auto) reusing the existing script_executable column already used by unix_script tasks. The choice is validated, persisted, and threaded through to wingetcfg.ExecutePowershellScript for both the ad-hoc "run task now" and scheduled profile-application flows. Depends on open-uem/wingetcfg#feat/powershell-7-engine landing and a new wingetcfg version being pinned in go.mod before this builds.
Author
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
script_executablecolumn already used byunix_scripttasks — no schema migration needed.validatePowerShellScript, persisted inAddTaskToProfile/UpdateProfileTask, and threaded through towingetcfg.ExecutePowershellScriptfor both the ad-hoc "run task now" and scheduled profile-application flows.Depends on
go.modbefore this builds.Test plan
Verified end-to-end on a real Hyper-V lab (see openuem-agent#208 for full setup): logged into this console build, admitted a real Windows agent, created PowerShell tasks selecting each engine option from the new dropdown, and confirmed the agent executed each one under the correct PowerShell version — including the auto-detect and explicit-failure-when-missing cases.
go build ./...andtempl generatepassScriptExecutablewhen editing existing tasksScriptExecutable == "") continue to run unchanged under PowerShell 5.1