Comments (1)
Hi, @ethanhou99! Thanks for submitting this issue. I think the root of your problem here is that you're trying to use the configuration
keyword in PowerShell 7.2 / with DSC v3. v3 is still in preview at this time.
The documentation you were reading is for DSC v1.1. The getting started documentation for v3 is here and does not mention the configuration
keyword because it is not supported in v3.
Another significant change in DSC v3 is that only class-based DSC Resources are supported. While v3 is in preview, many resources have not yet been converted to be class-based. Unfortunately, this includes the Environment
resource.
If you'd like to use the documentation you were reading, you'd need to use Windows PowerShell 5.1 and DSC v1.1, which ships with that version of PowerShell. To ensure it loads properly, you'll need to either uninstall the newer version of the PSDesiredStateConfiguration module or ensure you import it with the MaximumVersion parameter set to 1.1:
Import-Module PSDesiredStateConfiguration -MaximumVersion 1.1
I'm going to close this issue for now, but if you have more questions or comments, please do let me know!
from powershell-docs-dsc.
Related Issues (20)
- This repo is missing important files
- Suggested Implementation of `Reasons` class raises errors for multi-module configurations
- Updates for PSDesiredStateConfiguration v2.0.6
- DSC 3.0 doc examples are outdated HOT 1
- Clarify name prefix requirements for classes and enums
- Updateable help cannot be found HOT 1
- PSDSC v3 is not DSC v3 HOT 2
- Document how to invoke DSC Resources with complex properties in v1.1
- Install-Module not pulling 3.0.0
- [DSC 2 - Write and compile a DSC Configuration]The example should include Example(configuration name) at the end of the configuration example HOT 1
- Incorrect script HOT 3
- The DSC WMI Provider might be called dsctimer
- Customer feedback - HOT 1
- Folder structure for a MOF resource part below folder structure is missing MyDscResources.psd1
- Dsc Script Resource docs should discourage use HOT 1
- Minor typo in "Get started with Desired State Configuration (DSC) for Windows" page
- Resource example missing `Import-DSCResource`
- Installation part is incomplete HOT 1
- DSC Node won't update resource after changing the resource's checksum HOT 2
- How to test the custom DSC resource with MOF? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powershell-docs-dsc.