-
Notifications
You must be signed in to change notification settings - Fork 189
Description
Describe the bug
If we created the dev pool with the image Windows 11+ Optimizations 23H2, then upload the yaml below,
After the dev box is provisioned, VSCode and Python are not installed.
Note: we also used Windows 11 + VS2022 (including PowerShell7), VSCode and Python are installed.
To Reproduce
Steps to reproduce the behavior:
- Create the dev box pool using the image
- Create the dev box in the dev portal, using the customization file below:
`
setupTasks:
- task: powershell
inputs:
command: |
"New-Item -Type Directory -Path 'c:\' -Name qt-custom" - task: winget
inputs:
package: Microsoft.VisualStudioCode
runAsUser: true - task: winget
inputs:
package: Python.Python.3.11
runAsUser: true - task: winget
inputs:
package: Amazon.AWSCLI - task: winget
inputs:
package: RubyInstallerTeam.Ruby.3.2 - task: winget
inputs:
package: Oracle.JDK.17 - task: powershell-runas
inputs:
command: '& "$env:LOCALAPPDATA\Programs\Microsoft VS Code\bin\code" --install-extension github.copilot'
runAsUser: true
`
please check the snapshot, the code above is changed by markdown
- Login to dev box, wait for the popped PowerShell windows to execute
Expected behavior
VSCode and Python should be installed.
Screenshots
In the C:\devboxcustomizations, runAsUser.ps1 is as below, it looks ok:

But when execute the command, it give the error

After we manually execute the repair code, it can install VSCode.
![]()
So the issue is that when the task schedule launched the PowerShell, even in the script, there is the command Repair-WinGetPackageManager, but it cannot be executed successfully.
Dev Box VM Details (please complete the following information):
- OS version: Windows 11+ Optimizations 23H2
Additional context
by the way, Amazon CLI and JDK are installed because it's executed under system role