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

Custom `psmodulepath` not supported in `Microsoft.Adapter/PowerShell`

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

Maintainer thường phản hồi trong vòng 1 ngày

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
35/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
cli, tooling

Hướng nghiên cứu

Tái hiện cả hai ví dụ YAML bằng dsc config get với dsc 3.2.0-preview.11, sau đó theo dõi cách Microsoft.Adapter/PowerShell xử lý thuộc tính psmodulepath. Được xem là hoàn tất khi một đường dẫn module tùy chỉnh được chấp nhận trong cấu hình dựa trên adapter mới và lệnh hoàn tất mà không gặp ngoại lệ thiếu thuộc tính.

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

Mô tả

Issue-Enhancement WG-Reviewed
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.
Summary

I was trying out the new Microsoft.Adapter/PowerShell and use the psmodulepath to add custom modules, but it doesn't seem to work. In the old way, it's possible to do something like:

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
  - name: Custom module 
    type: Microsoft.DSC/PowerShell
    properties:
      psmodulepath: C:\CustomModules;<existingModulePaths>
      resources:
        - name: PowerShell 7 Preview
          type: Microsoft.WinGet.DSC/WinGetPackage    # Direct resource type
          properties:
            Id: Microsoft.PowerShell.Preview
            Ensure: Present

Then, in the new way, I would expect something like:

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
  - name: PowerShell 7 Preview
    type: Microsoft.WinGet.DSC/WinGetPackage    
    metadata:
      Microsoft.DSC:
        requireAdapter: Microsoft.Adapter/PowerShell 
    # psmodulepath: C:\CustomModules
    properties:
      Id: Microsoft.PowerShell.Preview
      Ensure: Present
      psmodulepath: C:\CustomModules;<existingModulePaths>

But that's going to fail with: Exception: The property 'psmodulepath' cannot be found on this object. Verify that the property exists and can be set.

Steps to reproduce

Run above examples with dsc config get

Expected behavior
Expect to be able to use custom module paths.
Actual behavior
Not able to use custom module path
Error details

Environment data
Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.26200
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Version

dsc 3.2.0-preview.11

Visuals

No response

Ngôn ngữ chính
Rust
Star
536
Fork
76
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
15

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 PowerShell/DSC

Tất cả issue của PowerShell/DSC

Issue tương tự

Thêm issue về Rust

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.