Skip to content

Commit 584dfb6

Browse files
authored
Copy sampleConfigurations folder from devhome repo to a samples folder (#133)
* Copy entire folder from devhome repository * Update README URL * markdown + general lint fixes * Update sandbox script as per microsoft/devhome#3984 * spelling * try again * markdownlint
1 parent 569b657 commit 584dfb6

42 files changed

Lines changed: 1360 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/spelling/allow.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,25 @@ pscustomobject
4343
VGpu
4444
wildcards
4545
worktree
46+
aspnetcore
47+
bbwe
48+
devdocs
49+
echarts
50+
ephemoral
51+
Fancyzones
52+
gdk
53+
JDK
54+
jquery
55+
Mfor
56+
msixbundle
57+
NVM
58+
powertoys
59+
reduxjs
60+
restsource
61+
seperated
62+
tastejs
63+
todomvc
64+
videojs
65+
vsconfig
66+
websites
67+
wekyb

.github/actions/spelling/patterns.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ name\:\s+.+$
7171

7272
# Github User Content
7373
/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]*
74+
75+
# GitHub SHAs (markdown)
76+
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DSC Resources for WinGet Configuration
22

3-
This project is intended to support WinGet Configuration. Some of these Desired State Configuration (DSC) Resources are exploratory and may not be published in the PowerShell Gallery. Other resources may be moved to their own projects or removed entirely. [Samples](https://aka.ms/dsc.yaml) for using these resources are available in the [Dev Home](https://github.com/microsoft/devhome) repository.
3+
This project is intended to support WinGet Configuration. Some of these Desired State Configuration (DSC) Resources are exploratory and may not be published in the PowerShell Gallery. Other resources may be moved to their own projects or removed entirely. Samples for using these resources are available in the [samples](./samples/) directory. They are also available via the URL: `https://aka.ms/dsc.yaml`
44

55
## Contributing
66

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
3+
########################################################################################
4+
# This configuration will clone the winget-cli repository to a specified location. #
5+
# PowerShell module: GitDsc (v0.1.3-alpha) #
6+
########################################################################################
7+
8+
properties:
9+
resources:
10+
- resource: Microsoft.WinGet.DSC/WinGetPackage
11+
directives:
12+
description: Install Git
13+
allowPrerelease: true
14+
settings:
15+
id: Git.Git
16+
source: winget
17+
- resource: GitDsc/GitClone
18+
directives:
19+
description: Clone the winget-cli repository
20+
allowPrerelease: true
21+
settings:
22+
HttpsUrl: https://github.com/microsoft/winget-cli.git
23+
RootDirectory: '${WingetConfigRoot}/SampleRepos/'
24+
# - resource: GitDsc/GitRemote
25+
# directives:
26+
# description: Add a remote repository to the cloned winget-cli repository.
27+
# allowPrerelease: true
28+
# settings:
29+
# RemoteName: exampleName
30+
# RemoteUrl: https://github.com/exampleName/winget-cli.git
31+
# ProjectDirectory: '${WingetConfigRoot}/SampleRepos/winget-cli'
32+
configurationVersion: 0.2.0
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
3+
###########################################################################
4+
# This configuration will modify various Windows Settings. #
5+
# PowerShell module: Microsoft.Windows.Developer (v0.2.1-alpha) #
6+
###########################################################################
7+
8+
properties:
9+
resources:
10+
- resource: Microsoft.Windows.Developer/Taskbar
11+
directives:
12+
description: Modify taskbar settings
13+
allowPrerelease: true
14+
settings:
15+
Alignment: Left # [KeepCurrentValue, Middle]
16+
HideLabelsMode: Never # [KeepCurrentValue, WhenFull, Always]
17+
SearchBoxMode: ShowIconAndLabel # [KeepCurrentValue, ShowIconOnly, SearchBox, Hide]
18+
TaskViewButton: Show # [KeepCurrentValue, Hide]
19+
WidgetsButton: Show # [KeepCurrentValue, Hide]
20+
RestartExplorer: True # Use caution when setting `RestartExplorer: true` as this will force explorer to close. Required for `HideLabelsMode`.
21+
- resource: Microsoft.Windows.Developer/WindowsExplorer
22+
directives:
23+
description: Modify Windows Explorer settings
24+
allowPrerelease: true
25+
settings:
26+
FileExtensions: Hide # [KeepCurrentValue, Hide]
27+
HiddenFiles: Hide # [KeepCurrentValue, Hide]
28+
ItemCheckBoxes: Hide # [KeepCurrentValue, Hide]
29+
RestartExplorer: True # Use caution when setting `RestartExplorer: true` as this will force explorer to close. Required for all WindowsExplorer settings.
30+
- resource: Microsoft.Windows.Developer/ShowSecondsInClock
31+
directives:
32+
description: Show seconds in clock
33+
allowPrerelease: true
34+
settings:
35+
Ensure: Present
36+
- resource: Microsoft.Windows.Developer/EnableDarkMode
37+
directives:
38+
description: Disable dark mode
39+
allowPrerelease: true
40+
settings:
41+
Ensure: Absent
42+
# Use caution when setting `RestartExplorer: true` as this will force explorer to close.
43+
RestartExplorer: true # Required to apply changes
44+
configurationVersion: 0.2.0
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
3+
###########################################################################
4+
# This configuration will revert various Windows Settings. #
5+
# PowerShell module: Microsoft.Windows.Developer (v0.2.1-alpha) #
6+
###########################################################################
7+
8+
properties:
9+
resources:
10+
- resource: Microsoft.Windows.Developer/Taskbar
11+
directives:
12+
description: Revert taskbar settings
13+
allowPrerelease: true
14+
settings:
15+
Alignment: Middle # [KeepCurrentValue, Left]
16+
HideLabelsMode: Always # [KeepCurrentValue, WhenFull, Never]
17+
SearchBoxMode: Hide # [KeepCurrentValue, ShowIconOnly, SearchBox, ShowIconAndLabel]
18+
TaskViewButton: Hide # [KeepCurrentValue, Show]
19+
WidgetsButton: Hide # [KeepCurrentValue, Show]
20+
RestartExplorer: True # Use caution when setting `RestartExplorer: true` as this will force explorer to close. Required for `HideLabelsMode`.
21+
- resource: Microsoft.Windows.Developer/WindowsExplorer
22+
directives:
23+
description: Revert Windows Explorer settings
24+
allowPrerelease: true
25+
settings:
26+
FileExtensions: Show # [KeepCurrentValue, Hide]
27+
HiddenFiles: Show # [KeepCurrentValue, Hide]
28+
ItemCheckBoxes: Show # [KeepCurrentValue, Hide]
29+
RestartExplorer: # Use caution when setting `RestartExplorer: true` as this will force explorer to close. Required for all WindowsExplorer settings.
30+
- resource: Microsoft.Windows.Developer/ShowSecondsInClock
31+
directives:
32+
description: Hide seconds in clock
33+
allowPrerelease: true
34+
settings:
35+
Ensure: Absent
36+
- resource: Microsoft.Windows.Developer/EnableDarkMode
37+
directives:
38+
description: Enable dark mode
39+
allowPrerelease: true
40+
settings:
41+
Ensure: Present
42+
# Use caution when setting `RestartExplorer: true` as this will force explorer to close.
43+
RestartExplorer: true # Required to apply changes
44+
configurationVersion: 0.2.0
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Microsoft.WindowsSandbox.DSC
2+
3+
The [Microsoft.WindowsSandbox.DSC](https://www.powershellgallery.com/packages/Microsoft.WindowsSandbox.DSC) PowerShell module contains the WindowsSandbox DSC Resource. This resource accepts either a reference to a Windows Sandbox .WSB file or properties to configure and launch an instance of the Windows Sandbox.
4+
5+
>Note: The Windows Sandbox is an ephemoral instance of Windows. It also defaults to an administrative context when running the LogonCommand.
6+
7+
Prior to running this configuration, users should be on either Windows PRO or Windows enterprise. The "Windows Sandbox" optional feature also needs to be enabled.
8+
9+
The "full.sandbox.dsc.yaml" configuration is not fully capable of verifying the Windows SKU or enabling Windows optional features via the WinGet CLI (and subsequently Dev Home). The Windows optional features can be enabled in a configuration when run via the Microsoft.WinGet.Configuration.
10+
11+
The "full.sandbox.dsc.yaml" configuration can be run via the Microsoft.WinGet.Configuration module.
12+
13+
Install the module using:
14+
15+
```PowerShell
16+
Install-Module -Name Microsoft.WindowsSandbox.DSC -AllowPrerelease
17+
```
18+
19+
Run the configuration in PowerShell 7 using:
20+
21+
```PowerShell
22+
get-WinGetConfiguration -File full.sandbox.dsc.yaml | Invoke-WinGetConfiguration
23+
```
24+
25+
## How to use the WinGet Configuration File
26+
27+
The following two options are available for running a WinGet Configuration file on your device.
28+
29+
### 1. Windows Package Manager
30+
31+
1. Download the `sandbox.dsc.yaml` file to your computer.
32+
1. Open your Windows Start Menu, search and launch "*Windows Terminal*".
33+
1. Type the following: `CD <C:\Users\User\Download>`
34+
1. Type the following: `winget configure --file .\sandbox.dsc.yaml`
35+
36+
### 2. Dev Home
37+
38+
1. Download the `sandbox.dsc.yaml` file to your computer.
39+
1. Open your Windows Start Menu, search and launch "*Dev Home*".
40+
1. Select the *Machine Configuration* button on the left side navigation.
41+
1. Select the *Configuration file* button
42+
1. Locate and open the WinGet Configuration file downloaded in "step 1".
43+
1. Select the "I agree and want to continue" checkbox.
44+
1. Select the "Set up as admin" button.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
3+
###############################################################################
4+
# Create Windows Sandbox instance with WinGet installed. #
5+
# Run as Administrator #
6+
# Mount C:\Sandbox on the local filesystem into the Sandbox filesystem. #
7+
# The Logon command performs the following steps in Windows PowerShell: #
8+
# 1. Set the execution policy to RemoteSigned #
9+
# 2. Download and install Microsoft.WinGet.Client PowerShell Module #
10+
# 3. Use Repair-WinGetPackageManager cmdlet to bootstrap WinGet #
11+
###############################################################################
12+
13+
properties:
14+
resources:
15+
- resource: PSDscResources/WindowsOptionalFeature
16+
id: WindowsSandbox
17+
directives:
18+
description: Ensure Windows Sandbox is enabled
19+
settings:
20+
Name: Containers-DisposableClientVM
21+
Ensure: Present
22+
- resource: Microsoft.WindowsSandbox.DSC/WindowsSandbox
23+
dependsOn:
24+
- WindowsSandbox
25+
directives:
26+
description: Create Windows Sandbox with Winget installed
27+
allowPrerelease: true
28+
settings:
29+
Ensure: Present
30+
HostFolder: C:\Sandbox
31+
SandboxFolder: C:\Sandbox
32+
LogonCommand: >
33+
cmd /c start powershell -NoExit -Command "$progressPreference = 'silentlyContinue';
34+
Write-Host 'Setting execution policy to remote signed...' `n;
35+
Set-ExecutionPolicy RemoteSigned -Force;
36+
Write-Host "Installing WinGet PowerShell module from PSGallery...";
37+
Install-PackageProvider -Name NuGet -Force | Out-Null;
38+
Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null;
39+
Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet...";
40+
Repair-WinGetPackageManager;
41+
Write-Host "Done.";
42+
configurationVersion: 0.2.0
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
3+
###############################################################################
4+
# Create Windows Sandbox instance with WinGet installed. #
5+
# Run as Administrator #
6+
# Mount C:\Sandbox on the local filesystem into the Sandbox filesystem. #
7+
# The Logon command performs the following steps in Windows PowerShell: #
8+
# 1. Set the execution policy to RemoteSigned #
9+
# 2. Download and install Microsoft.WinGet.Client PowerShell Module #
10+
# 3. Use Repair-WinGetPackageManager cmdlet to bootstrap WinGet #
11+
###############################################################################
12+
13+
properties:
14+
resources:
15+
- resource: Microsoft.WindowsSandbox.DSC/WindowsSandbox
16+
directives:
17+
description: Create Windows Sandbox with Winget installed
18+
allowPrerelease: true
19+
settings:
20+
Ensure: Present
21+
#WsbFile: <Provide a custom .wsb file to open. The parameters below will override existing values in the wsb file>
22+
LogonCommand: >
23+
cmd /c start powershell -NoExit -Command "$progressPreference = 'silentlyContinue';
24+
Write-Host 'Setting execution policy to remote signed...' `n;
25+
Set-ExecutionPolicy RemoteSigned -Force;
26+
Write-Host "Installing WinGet PowerShell module from PSGallery...";
27+
Install-PackageProvider -Name NuGet -Force | Out-Null;
28+
Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null;
29+
Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet...";
30+
Repair-WinGetPackageManager;
31+
Write-Host "Done.";
32+
#HostFolder: <Absolute path to folder on host machine that will be shared into the Windows Sandbox>
33+
#SandboxFolder: <Absolute path to destination in the sandbox to map the Host Folder to>
34+
#ReadOnly: false
35+
#MemoryInMB: 2048
36+
#vGPU: true
37+
#AudioInput: true
38+
#ClipboardRedirection: true
39+
#Networking: true
40+
#PrinterRedirection: false
41+
#ProtectedClient: false
42+
#VideoInput: true
43+
configurationVersion: 0.2.0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
################################################################################
2+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 #
3+
# #
4+
# This DSC config file will install Microsoft.PowerToys, then configure, by: #
5+
# Disabling the ShortcutGuide and setting it to full opacity, then enabling #
6+
# Fancy Zones and setting the Fancy Zone Editor hotkey to Shift+Ctrl+Alt+F. #
7+
# #
8+
################################################################################
9+
#
10+
properties:
11+
configurationVersion: 0.2.0
12+
resources:
13+
- resource: Microsoft.WinGet.DSC/WinGetPackage
14+
directives:
15+
description: Install PowerToys
16+
allowPrerelease: true
17+
settings:
18+
id: Microsoft.PowerToys
19+
source: winget
20+
- resource: PowerToysConfigure
21+
directives:
22+
description: Configure PowerToys
23+
settings:
24+
ShortcutGuide:
25+
Enabled: false
26+
OverlayOpacity: 1
27+
FancyZones:
28+
Enabled: true
29+
FancyzonesEditorHotkey: "Shift+Ctrl+Alt+F"

0 commit comments

Comments
 (0)