Skip to content

Commit

Permalink
[DSC]Improve samples (microsoft#32494)
Browse files Browse the repository at this point in the history
* Add DSC sample to install and configure

* [DSC]Make configure action depend on install

* [DSC]Add schema header for yaml-language-server

* Use full resource name for quick finding by winget

* Add index page to the DSC sample files
  • Loading branch information
jaimecbernardo committed Apr 17, 2024
1 parent db767a0 commit 31df322
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 12 deletions.
26 changes: 26 additions & 0 deletions src/dsc/Microsoft.PowerToys.Configure/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# PowerToys Desired State Configuration samples

This folder contains samples of DSC files that can be used to configure PowerToys.

> [!NOTE]
> PowerToys DSC user documentation can be found on [Learn Microsoft PowerToys documentation](https://aka.ms/powertoys-docs-dsc-configure).
### [configuration.dsc.yaml](./configuration.dsc.yaml)

Sample configuration file that changes the enabled state of some modules, changes an integer setting and a hotkey setting.

### [installAndConfiguration.dsc.yaml](./installAndConfiguration.dsc.yaml)

Installs PowerToys and applies configuration.dsc.yaml to it.

### [enableAllModules.dsc.yaml](./enableAllModules.dsc.yaml)

Enables all PowerToys utilities.

### [disableAllModules.dsc.yaml](./disableAllModules.dsc.yaml)

Disables all PowerToys utilities.

### [configureLauncherPlugins.dsc.yaml](./configureLauncherPlugins.dsc.yaml)

Enables PowerToys Run and all its plugins and changes action keyword and global state for the Program plugin.
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
# - resource: Microsoft.WinGet.DSC/WinGetPackage
# directives:
# description: Install PowerToys
# allowPrerelease: true
# settings:
# id: PowerToys (Preview)
# source: winget

- resource: PowerToysConfigure
- resource: Microsoft.PowerToys.Configure/PowerToysConfigure
directives:
description: Configure PowerToys
settings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: PowerToysConfigure
- resource: Microsoft.PowerToys.Configure/PowerToysConfigure
directives:
description: Configure PowerToys
settings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: PowerToysConfigure
- resource: Microsoft.PowerToys.Configure/PowerToysConfigure
directives:
description: Configure PowerToys
settings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: PowerToysConfigure
- resource: Microsoft.PowerToys.Configure/PowerToysConfigure
directives:
description: Configure PowerToys
settings:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: installPowerToys
directives:
description: Install PowerToys
allowPrerelease: true
settings:
id: Microsoft.PowerToys
source: winget

- resource: Microsoft.PowerToys.Configure/PowerToysConfigure
dependsOn:
- installPowerToys
directives:
description: Configure PowerToys
settings:
ShortcutGuide:
Enabled: false
OverlayOpacity: 50
FancyZones:
Enabled: true
FancyzonesEditorHotkey: "Shift+Ctrl+Alt+F"
FileLocksmith:
Enabled: false
configurationVersion: 0.2.0

0 comments on commit 31df322

Please sign in to comment.