From 0f56b5fc3a6e109014a4bd049fe679a7e9623b7a Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 5 Nov 2024 13:25:18 -0600 Subject: [PATCH 1/4] Add Powershell to the recommended extensions --- .vscode/extensions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 33d1ff21..24b6530a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,7 @@ { "recommendations": [ "redhat.vscode-yaml", - "EditorConfig.EditorConfig" + "EditorConfig.EditorConfig", + "ms-vscode.powershell" ] } From 390a94c3938594bd48aab3f10a091079c825173b Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 5 Nov 2024 13:59:55 -0600 Subject: [PATCH 2/4] Add configuration.dsc.yaml --- .configurations/configuration.dsc.yaml | 96 ++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .configurations/configuration.dsc.yaml diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml new file mode 100644 index 00000000..c328b46b --- /dev/null +++ b/.configurations/configuration.dsc.yaml @@ -0,0 +1,96 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +properties: + resources: + ######################################################################## + # Section: Install VS-Code + ######################################################################## + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: install-vs-code + directives: + description: Install Microsoft Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + Ensure: Present + - resource: vscode/VSCodeExtension + dependsOn: + - install-vs-code + directives: + description: Install YAML extension for VSCode + allowPrerelease: true + settings: + Name: redhat.vscode-yaml + Ensure: Present + - resource: vscode/VSCodeExtension + dependsOn: + - install-vs-code + directives: + description: Install EditorConfig extension for VSCode + allowPrerelease: true + settings: + Name: EditorConfig.EditorConfig + Ensure: Present + - resource: vscode/VSCodeExtension + dependsOn: + - install-vs-code + directives: + description: Install PowerShell extension for VSCode + allowPrerelease: true + settings: + Name: ms-vscode.powershell + Ensure: Present + ######################################################################## + # Section: Install Packages + ######################################################################## + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: install-git + directives: + description: Install Git # Although the user probably already has git installed, it's possible that they don't + allowPrerelease: true + settings: + id: Git.Git + source: winget + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: install-git-cli + directives: + description: Install GitHub CLI + allowPrerelease: true + settings: + id: GitHub.cli + source: winget + Ensure: Present + ######################################################################## + # Section: Configure Git Remotes + ######################################################################## + - resource: GitDSC/GitRemote + id: add-microsoft-upstream + directives: + description: Add microsoft/winget-dsc as the upstream remote + allowPrerelease: true + settings: + ProjectDirectory: '${WinGetConfigRoot}\..' + RemoteName: upstream + RemoteUrl: https://github.com/microsoft/winget-pkgs.git + ######################################################################## + # Section: Install PowerShell Modules + ######################################################################## + - resource: PowerShellModule/PSModuleResource + id: install-pester + directives: + description: Install Pester module + allowPrerelease: true + settings: + Module_Name: Pester + Ensure: Present + - resource: PowerShellModule/PSModuleResource + id: install-psscriptanalyzer + directives: + description: Install PSScriptAnalyzer module + allowPrerelease: true + settings: + Module_Name: PSScriptAnalyzer + Ensure: Present + configurationVersion: 0.2.0 From bf677406b6c3bd84e0b1ddd186fbd4f478fa59b3 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 5 Nov 2024 16:55:06 -0600 Subject: [PATCH 3/4] Add IDs, Enhance Order, and configure elevation --- .configurations/configuration.dsc.yaml | 72 ++++++++++++++------------ 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml index c328b46b..b8a44285 100644 --- a/.configurations/configuration.dsc.yaml +++ b/.configurations/configuration.dsc.yaml @@ -3,6 +3,42 @@ properties: resources: ######################################################################## + # Section: Install Git + ######################################################################## + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: install-git + directives: + description: Install Git # Although the user probably already has git installed, it's possible that they don't + allowPrerelease: true + settings: + id: Git.Git + source: winget + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + dependsOn: + - install-git + id: install-github-cli + directives: + description: Install GitHub CLI + allowPrerelease: true + securityContext: elevated + settings: + id: GitHub.cli + source: winget + Ensure: Present + ######################################################################## + # Section: Configure Git Remotes + ######################################################################## + - resource: GitDSC/GitRemote + id: add-microsoft-upstream + directives: + description: Add microsoft/winget-dsc as the upstream remote + allowPrerelease: true + settings: + ProjectDirectory: '${WinGetConfigRoot}\..' + RemoteName: upstream + RemoteUrl: https://github.com/microsoft/winget-pkgs.git + ######################################################################## # Section: Install VS-Code ######################################################################## - resource: Microsoft.WinGet.DSC/WinGetPackage @@ -15,6 +51,7 @@ properties: source: winget Ensure: Present - resource: vscode/VSCodeExtension + id: install-vscode-extension_vscode-yaml dependsOn: - install-vs-code directives: @@ -24,6 +61,7 @@ properties: Name: redhat.vscode-yaml Ensure: Present - resource: vscode/VSCodeExtension + id: install-vscode-extension_editorconfig.editorconfig dependsOn: - install-vs-code directives: @@ -33,6 +71,7 @@ properties: Name: EditorConfig.EditorConfig Ensure: Present - resource: vscode/VSCodeExtension + id: install-vsscode-extension_ms-vscode.powershell dependsOn: - install-vs-code directives: @@ -42,39 +81,6 @@ properties: Name: ms-vscode.powershell Ensure: Present ######################################################################## - # Section: Install Packages - ######################################################################## - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: install-git - directives: - description: Install Git # Although the user probably already has git installed, it's possible that they don't - allowPrerelease: true - settings: - id: Git.Git - source: winget - Ensure: Present - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: install-git-cli - directives: - description: Install GitHub CLI - allowPrerelease: true - settings: - id: GitHub.cli - source: winget - Ensure: Present - ######################################################################## - # Section: Configure Git Remotes - ######################################################################## - - resource: GitDSC/GitRemote - id: add-microsoft-upstream - directives: - description: Add microsoft/winget-dsc as the upstream remote - allowPrerelease: true - settings: - ProjectDirectory: '${WinGetConfigRoot}\..' - RemoteName: upstream - RemoteUrl: https://github.com/microsoft/winget-pkgs.git - ######################################################################## # Section: Install PowerShell Modules ######################################################################## - resource: PowerShellModule/PSModuleResource From a1a898c99facd5bc45879bab115c6ac89036d231 Mon Sep 17 00:00:00 2001 From: Kaleb Luedtke Date: Tue, 5 Nov 2024 18:59:17 -0600 Subject: [PATCH 4/4] Use the official Vscode DSC module --- .configurations/configuration.dsc.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml index b8a44285..51049b00 100644 --- a/.configurations/configuration.dsc.yaml +++ b/.configurations/configuration.dsc.yaml @@ -50,8 +50,8 @@ properties: id: Microsoft.VisualStudioCode source: winget Ensure: Present - - resource: vscode/VSCodeExtension - id: install-vscode-extension_vscode-yaml + - resource: Microsoft.VSCode.Dsc/VSCodeExtension + id: install_vscode-yaml dependsOn: - install-vs-code directives: @@ -59,9 +59,9 @@ properties: allowPrerelease: true settings: Name: redhat.vscode-yaml - Ensure: Present - - resource: vscode/VSCodeExtension - id: install-vscode-extension_editorconfig.editorconfig + Exist: true + - resource: Microsoft.VSCode.Dsc/VSCodeExtension + id: install_editorconfig.editorconfig dependsOn: - install-vs-code directives: @@ -69,9 +69,9 @@ properties: allowPrerelease: true settings: Name: EditorConfig.EditorConfig - Ensure: Present - - resource: vscode/VSCodeExtension - id: install-vsscode-extension_ms-vscode.powershell + Exist: true + - resource: Microsoft.VSCode.Dsc/VSCodeExtension + id: install_ms-vscode.powershell dependsOn: - install-vs-code directives: @@ -79,7 +79,7 @@ properties: allowPrerelease: true settings: Name: ms-vscode.powershell - Ensure: Present + Exist: true ######################################################################## # Section: Install PowerShell Modules ########################################################################