From 31df322f706af94c8ac5ea04f1cdbe744493336b Mon Sep 17 00:00:00 2001 From: Jaime Bernardo Date: Wed, 17 Apr 2024 17:55:09 +0100 Subject: [PATCH] [DSC]Improve samples (#32494) * 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 --- .../examples/README.md | 26 ++++++++++++++++++ .../examples/configuration.dsc.yaml | 11 ++------ .../configureLauncherPlugins.dsc.yaml | 3 ++- .../examples/disableAllModules.dsc.yaml | 3 ++- .../examples/enableAllModules.dsc.yaml | 3 ++- .../examples/installAndConfiguration.dsc.yaml | 27 +++++++++++++++++++ 6 files changed, 61 insertions(+), 12 deletions(-) create mode 100644 src/dsc/Microsoft.PowerToys.Configure/examples/README.md create mode 100644 src/dsc/Microsoft.PowerToys.Configure/examples/installAndConfiguration.dsc.yaml diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/README.md b/src/dsc/Microsoft.PowerToys.Configure/examples/README.md new file mode 100644 index 0000000000..750b59e2db --- /dev/null +++ b/src/dsc/Microsoft.PowerToys.Configure/examples/README.md @@ -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. diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/configuration.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/configuration.dsc.yaml index 900f81034c..3294aa75a8 100644 --- a/src/dsc/Microsoft.PowerToys.Configure/examples/configuration.dsc.yaml +++ b/src/dsc/Microsoft.PowerToys.Configure/examples/configuration.dsc.yaml @@ -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: diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/configureLauncherPlugins.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/configureLauncherPlugins.dsc.yaml index 6aec96f489..2a57f78876 100644 --- a/src/dsc/Microsoft.PowerToys.Configure/examples/configureLauncherPlugins.dsc.yaml +++ b/src/dsc/Microsoft.PowerToys.Configure/examples/configureLauncherPlugins.dsc.yaml @@ -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: diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml index 5cbcad3e33..248ee7c276 100644 --- a/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml +++ b/src/dsc/Microsoft.PowerToys.Configure/examples/disableAllModules.dsc.yaml @@ -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: diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml index cfa23df014..3e1a05d25e 100644 --- a/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml +++ b/src/dsc/Microsoft.PowerToys.Configure/examples/enableAllModules.dsc.yaml @@ -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: diff --git a/src/dsc/Microsoft.PowerToys.Configure/examples/installAndConfiguration.dsc.yaml b/src/dsc/Microsoft.PowerToys.Configure/examples/installAndConfiguration.dsc.yaml new file mode 100644 index 0000000000..9b9b8c2408 --- /dev/null +++ b/src/dsc/Microsoft.PowerToys.Configure/examples/installAndConfiguration.dsc.yaml @@ -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