Skip to content

Commit 09a4660

Browse files
committed
Updates for the WinGet configuration sample
1 parent 2fedf5e commit 09a4660

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

hub/package-manager/configuration/create.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,18 @@ properties:
6262
settings:
6363
MinVersion: '10.0.22000'
6464
resources:
65-
- resource: Microsoft.Windows.Developer/DeveloperMode
65+
- resource: Microsoft.Windows.Settings/WindowsSettings
6666
directives:
6767
description: Enable Developer Mode
6868
allowPrerelease: true
69+
securityContext: elevated
6970
settings:
70-
Ensure: Present
71+
DeveloperMode: true
7172
- resource: Microsoft.WinGet.DSC/WinGetPackage
7273
id: vsPackage
7374
directives:
7475
description: Install Visual Studio 2022 Community
76+
securityContext: elevated
7577
settings:
7678
id: Microsoft.VisualStudio.2022.Community
7779
source: winget
@@ -81,6 +83,7 @@ properties:
8183
directives:
8284
description: Install required VS workloads from vsconfig file
8385
allowPrerelease: true
86+
securityContext: elevated
8487
settings:
8588
productId: Microsoft.VisualStudio.Product.Community
8689
channelId: VisualStudio.17.Release
@@ -99,7 +102,7 @@ The components of this file consist of:
99102

100103
4. **Resources**: Both the `assertions` and `resources` list sections consist of individual `resource` nodes to represent the set up task. The `resource` should be given the name of the PowerShell module followed by the name of the module's DSC resource that will be invoked to apply your desired state: `{ModuleName}/{DscResource}`. Each resource must include `directives` and `settings`. Optionally, it can also include an `id` value. When applying a configuration, WinGet will know to install the module from the [PowerShell Gallery](https://www.powershellgallery.com/packages) and invoke the specified [DSC resource](/powershell/dsc/concepts/resources).
101104

102-
5. **Directives**: The `directives` section provides information about the module and the resource. This section should include a `description` value to describe the configuration task being accomplished by the module. The `allowPrerelease` value enables you to choose whether or not the configuration will be allowed (`true`) to use "Prerelease" modules from the [PowerShell Gallery](https://www.powershellgallery.com/packages).
105+
5. **Directives**: The `directives` section provides information about the module and the resource. This section should include a `description` value to describe the configuration task being accomplished by the module. The `allowPrerelease` value enables you to choose whether or not the configuration will be allowed (`true`) to use "Prerelease" modules from the [PowerShell Gallery](https://www.powershellgallery.com/packages). Some DSC resources may need to run with administrator privileges. The `securityContext: elevated` field under the directives section of a resource indicates this requirement. When set to `elevated`, WinGet will prompt for one UAC approval at the start of the configuration. WinGet will then launch two processes: one that runs resources with elevated privileges and another that runs resources with the current user's privileges.
103106

104107
6. **Settings**: The `settings` value of a resource represents the collection of name-value pairs being passed to the PowerShell DSC Resource. Settings could represent anything from whether Developer Mode is enabled, to applying a reg key, or to establishing a particular network setting.
105108

0 commit comments

Comments
 (0)