Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,373 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
powershell
領域
cli, tooling

調査の方向性

dsc 3.2.0-preview.11 を使用して dsc config get で両方の YAML 例を再現し、その後 Microsoft.Adapter/PowerShell が psmodulepath プロパティをどのように処理するかを追跡します。新しいアダプターベースの構成でカスタムモジュールパスが受け入れられ、コマンドがプロパティ不足の例外なしに完了すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Rust
スター
532
フォーク
76
平均マージ
2日 10時間
マージ済み PR(30日)
15

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PowerShell/DSC のほかの issue

PowerShell/DSC の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。