Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Winget runasuser task cannot work correctly with the image Win11+optimized OS

Đang mở
#70 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
powershell
Lĩnh vực
operating-systems

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện chuỗi setupTasks trên image Windows 11+ Optimizations 23H2, tập trung vào các tác vụ winget có bật runAsUser. Kiểm tra C:\devboxcustomizations\runAsUser.ps1 và lệnh gọi Repair-WinGetPackageManager, sau đó so sánh chúng với quá trình sửa chữa thủ công đã thành công. Được coi là hoàn tất khi các tác vụ winget với runAsUser cài đặt VSCode và Python trong quá trình provisioning.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

  1. Create the dev box pool using the image
image
  1. 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
image
  1. 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:
image
But when execute the command, it give the error
image

After we manually execute the repair code, it can install VSCode.
image

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

Ngôn ngữ chính
PowerShell
Star
52
Fork
194
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/devcenter-catalog

Tất cả issue của microsoft/devcenter-catalog

Issue tương tự

Thêm issue về Operating Systems

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.