Skip to content

Commit 03c2bbe

Browse files
authored
Merge pull request #5427 from mdanish-kh/config-updates
Updates for the WinGet configuration sample
2 parents 58d229d + 4e69d51 commit 03c2bbe

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
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

hub/package-manager/configuration/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The benefits of using a WinGet Configuration file include:
2626
2727
## Use a WinGet Configuration file to configure your machine
2828

29-
To set up your machine using a WinGet Configuration file, use [winget configure](../winget/configure.md) in the command line. To use the `winget configure` command, you must be running WinGet version [v1.6.2631 or later](https://github.com/microsoft/winget-cli/releases).
29+
To set up your machine using a WinGet Configuration file, download the configuration file and double-click to invoke the configuration. Alternatively, use [winget configure](../winget/configure.md) in the command line. To use the `winget configure` command, you must be running WinGet version [v1.6.2631 or later](https://github.com/microsoft/winget-cli/releases).
3030

3131
## WinGet Configuration FAQs
3232

@@ -61,7 +61,7 @@ A benefit to the declarative (non-sequential) nature of WinGet configuration fil
6161

6262
### How do I use a WinGet Configuration file?
6363

64-
To run a WinGet Configuration file, use the [`winget configure` command](../winget/configure.md).
64+
To run a WinGet Configuration file, you can simply double-click to run the file in file explorer. Alternatively, you can use the [`winget configure` command](../winget/configure.md).
6565

6666
### How do I author a WinGet Configuration?
6767

0 commit comments

Comments
 (0)