From 09a466012c786a46eb0e488e5552c1157e8d3fe1 Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Sat, 10 May 2025 18:27:06 +0500 Subject: [PATCH 1/2] Updates for the WinGet configuration sample --- hub/package-manager/configuration/create.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hub/package-manager/configuration/create.md b/hub/package-manager/configuration/create.md index 85351a56c1..4ca32bbc7c 100644 --- a/hub/package-manager/configuration/create.md +++ b/hub/package-manager/configuration/create.md @@ -62,16 +62,18 @@ properties: settings: MinVersion: '10.0.22000' resources: - - resource: Microsoft.Windows.Developer/DeveloperMode + - resource: Microsoft.Windows.Settings/WindowsSettings directives: description: Enable Developer Mode allowPrerelease: true + securityContext: elevated settings: - Ensure: Present + DeveloperMode: true - resource: Microsoft.WinGet.DSC/WinGetPackage id: vsPackage directives: description: Install Visual Studio 2022 Community + securityContext: elevated settings: id: Microsoft.VisualStudio.2022.Community source: winget @@ -81,6 +83,7 @@ properties: directives: description: Install required VS workloads from vsconfig file allowPrerelease: true + securityContext: elevated settings: productId: Microsoft.VisualStudio.Product.Community channelId: VisualStudio.17.Release @@ -99,7 +102,7 @@ The components of this file consist of: 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). -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). +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. 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. From 4e69d5135dfeb1a53405fdb159d6e7a414ebf9ba Mon Sep 17 00:00:00 2001 From: Muhammad Danish <88161975+mdanish-kh@users.noreply.github.com> Date: Sat, 10 May 2025 18:38:09 +0500 Subject: [PATCH 2/2] WinGet configuration file can be launched via double-clicking --- hub/package-manager/configuration/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hub/package-manager/configuration/index.md b/hub/package-manager/configuration/index.md index b68c4927cd..0ac0eef1f9 100644 --- a/hub/package-manager/configuration/index.md +++ b/hub/package-manager/configuration/index.md @@ -26,7 +26,7 @@ The benefits of using a WinGet Configuration file include: ## Use a WinGet Configuration file to configure your machine -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). +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). ## WinGet Configuration FAQs @@ -61,7 +61,7 @@ A benefit to the declarative (non-sequential) nature of WinGet configuration fil ### How do I use a WinGet Configuration file? -To run a WinGet Configuration file, use the [`winget configure` command](../winget/configure.md). +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). ### How do I author a WinGet Configuration?