Custom `psmodulepath` not supported in `Microsoft.Adapter/PowerShell`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce both YAML examples with dsc config get using dsc 3.2.0-preview.11, then trace how Microsoft.Adapter/PowerShell handles the psmodulepath property. Done means a custom module path is accepted in the new adapter-based configuration and the command completes without the missing-property exception.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Rust
- Stars
- 546
- Forks
- 84
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 25
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/DSC
-
Issue-Bug Need-Review
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
PowerShell/DSC#1832 ·
Maintainers usually reply within 1 day
-
Issue-Bug Need-Review
Difficulty 1/5 Under an hour Newbie friendliness 72/100
PowerShell/DSC#1831 ·
Maintainers usually reply within 1 day
-
Area-OpenTelemetry Issue-Enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
PowerShell/DSC#1821 ·
Maintainers usually reply within 1 day
-
Issue-Enhancement Needs Triage
Difficulty 4/5 3-5 days Newbie friendliness 22/100
PowerShell/DSC#1811 ·
Maintainers usually reply within 1 day
-
Issue-Enhancement Needs Triage
Difficulty 4/5 3-5 days Newbie friendliness 30/100
PowerShell/DSC#1812 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
autofixer: follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tursodatabase/turso#12531 ·
Maintainers usually reply within 1 day
-
bug help wanted ui
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
userFRM/egui-charts#4292 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Tripstack-Corp/spyc#1352 ·
Maintainers usually reply within 1 day