diff --git a/DSC-v3-Migration-Guide.md b/DSC-v3-Migration-Guide.md new file mode 100644 index 0000000..d5b866d --- /dev/null +++ b/DSC-v3-Migration-Guide.md @@ -0,0 +1,187 @@ +# DSC v3 Migration Guide + +This document outlines the migration from DSC v2 (0.2) to DSC v3 format in the ATC WinGet Configurations repository. + +## Overview + +All configuration files have been migrated from DSC v2 format to DSC v3 format to provide: +- **Better Performance**: Improved execution speed and resource management +- **Enhanced Error Handling**: More detailed error messages and diagnostics +- **Structured Output**: JSON-formatted results for better programmatic integration +- **Modern Schema**: Latest DSC v3 schema with improved validation + +## What Changed + +### Schema Updates +```yaml +# Old DSC v2 +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +# New DSC v3 +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json +``` + +### Structure Changes +```yaml +# Old DSC v2 Structure +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: MyApp + settings: + id: MyApp.Id + +# New DSC v3 Structure +metadata: + Microsoft.DSC: + securityContext: elevated +resources: + - name: My Applications + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: MyApp + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: MyApp.Id + UseLatest: true + Ensure: Present +``` + +### Resource Wrapping +- **WinGet Packages**: Now wrapped in `Microsoft.DSC/PowerShell` containers +- **Script Resources**: Converted to `PSDesiredStateConfiguration/Script` within `Microsoft.Windows/WindowsPowerShell` containers +- **Windows Settings**: Grouped logically within PowerShell containers + +### Dependency Syntax +```yaml +# Old DSC v2 +dependsOn: + - MyApp + +# New DSC v3 +dependsOn: + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','MyApp')]" +``` + +## Installation and Usage + +### 1. Install DSC v3 CLI (Recommended) +```powershell +# Via Microsoft Store +ms-appinstaller://DSC + +# Or download from GitHub +# https://github.com/PowerShell/DSC/releases +``` + +### 2. Verify Installation +```powershell +dsc --version +``` + +### 3. Apply Configurations + +**Option A: DSC v3 CLI** +```powershell +dsc config set -f .\configurations\dotnet-configuration.dsc.yaml +``` + +**Option B: WinGet (Fallback)** +```powershell +winget configure .\configurations\dotnet-configuration.dsc.yaml --accept-configuration-agreements +``` + +**Option C: Setup Script (Auto-Detection)** +```powershell +.\setup.ps1 +``` + +## Backward Compatibility + +The migration maintains full backward compatibility: +- **WinGet Support**: All DSC v3 configurations can still be executed using WinGet +- **Automatic Detection**: The setup script automatically detects available tools +- **Graceful Fallback**: Falls back to WinGet if DSC v3 CLI is not available + +## Benefits of DSC v3 + +### Better Error Handling +DSC v3 provides structured error messages: +```json +{ + "results": [ + { + "name": "MyApp", + "type": "Microsoft.WinGet.DSC/WinGetPackage", + "result": { + "beforeState": {}, + "afterState": {}, + "changedProperties": ["installed"] + } + } + ] +} +``` + +### Improved Performance +- Faster configuration parsing +- Optimized resource execution +- Better dependency resolution + +### Enhanced Validation +- Schema validation at design time +- Better IntelliSense support in VS Code +- Compile-time error detection + +## File Structure + +``` +/configurations/ # DSC v3 configurations (current) +├── *.dsc.yaml # All migrated configurations +├── *-vscode-extensions.json # VS Code extension definitions +├── dotnet-tools-configuration.json # .NET tools configuration +└── .vsconfig # Visual Studio workload configuration + +/configurations-dscv2-backup/ # Original DSC v2 configurations (backup) +└── *.dsc.yaml # Original configurations preserved + +/dscv3-configurations/ # Experimental DSC v3 configs (reference) +└── *.dsc.yaml # Early DSC v3 experiments +``` + +## Troubleshooting + +### DSC v3 CLI Not Found +If you see "DSC v3 CLI not found": +1. Install DSC v3 CLI as described above +2. Or use WinGet fallback: `winget configure .\configurations\your-config.dsc.yaml` + +### Configuration Validation Errors +If VS Code reports schema errors: +1. Ensure you have the latest YAML extension +2. Reload VS Code window +3. Check the schema URL is accessible + +### Script Resource Issues +If script resources fail: +1. Check PowerShell execution policy: `Get-ExecutionPolicy` +2. Set if needed: `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned` +3. Ensure admin privileges for system-level changes + +## Migration Validation + +To validate that a configuration works correctly: + +1. **Test Mode**: `dsc config test -f .\configurations\your-config.dsc.yaml` +2. **Apply Mode**: `dsc config set -f .\configurations\your-config.dsc.yaml` +3. **WinGet Validation**: `winget configure .\configurations\your-config.dsc.yaml --accept-configuration-agreements` + +## Support + +For issues related to: +- **DSC v3 CLI**: [PowerShell/DSC GitHub Repository](https://github.com/PowerShell/DSC) +- **WinGet**: [microsoft/winget-cli GitHub Repository](https://github.com/microsoft/winget-cli) +- **This Repository**: [atc-net/atc-winget-configurations Issues](https://github.com/atc-net/atc-winget-configurations/issues) \ No newline at end of file diff --git a/README.md b/README.md index 956ede1..3ed6676 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,18 @@ Using a WinGet Configuration file, you can consolidate manual machine setup and A YAML-formatted WinGet Configuration file that lists all of the software versions, packages, tools, dependencies, and settings required to set up the desired state of the development environment on your Windows machine. PowerShell Desired State Configuration (DSC) to automate the configuration of your Windows operating system. -Use the Windows Package Manager winget configure command to initiate the configuration process. +Use the Windows Package Manager winget configure command or DSC v3 CLI to initiate the configuration process. This repository contains multiple WinGet Configuration files for different profiles, enabling streamlined and reliable machine setup and project onboarding. +**🆕 DSC v3 Support**: All configurations have been migrated to DSC v3 format while maintaining backward compatibility with WinGet's built-in DSC support. + ## Table of Contents - [Atc.Winget.Configurations](#atcwingetconfigurations) - [Table of Contents](#table-of-contents) - [Efficient Winget Profile Management](#efficient-winget-profile-management) + - [DSC v3 Migration](#dsc-v3-migration) - [Customization - Personalizing Your Profile](#customization---personalizing-your-profile) - [Applying Profiles](#applying-profiles) - [Use Case Scenarios](#use-case-scenarios) @@ -23,6 +26,35 @@ This repository contains multiple WinGet Configuration files for different profi ## Efficient Winget Profile Management +### DSC v3 Migration + +All configurations in this repository have been migrated to **DSC v3 format** for improved performance, better error handling, and enhanced functionality. The migration includes: + +- **Updated Schema**: Configurations now use the DSC v3 schema (`$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json`) +- **Enhanced Structure**: Resources are now properly grouped and organized for better dependency management +- **Improved Error Handling**: Better diagnostics and troubleshooting information +- **Backward Compatibility**: The setup script automatically detects DSC v3 availability and falls back to WinGet when needed + +#### Using DSC v3 Configurations + +**Option 1: Using DSC v3 CLI (Recommended)** +```powershell +# Install DSC v3 CLI first (available via Microsoft Store or GitHub releases) +dsc config set -f .\configurations\dotnet-configuration.dsc.yaml +``` + +**Option 2: Using WinGet (Fallback)** +```powershell +# WinGet can still process DSC v3 configurations +winget configure .\configurations\dotnet-configuration.dsc.yaml --accept-configuration-agreements +``` + +**Option 3: Using the Setup Script** +```powershell +# The setup script automatically detects available tools +.\setup.ps1 +``` + ### Customization - Personalizing Your Profile These profiles are designed to be adaptable, allowing you to customize them according to your specific needs. Whether it's modifying the list of software, adjusting settings, or adding new functionalities, you can tailor each profile to create an ideal setup for your environment. @@ -57,8 +89,22 @@ If you're a Web Developer, the configuration is crafted to cater to your specifi ## Requirements -- [`Winget`](https://github.com/microsoft/winget-cli/releases) -- [`PowerShell`](https://github.com/microsoft/winget-cli/releases) +### Required +- [`WinGet`](https://github.com/microsoft/winget-cli/releases) - Windows Package Manager +- [`PowerShell`](https://github.com/PowerShell/PowerShell/releases) - PowerShell 5.1 or later + +### Recommended (for DSC v3 support) +- [`DSC v3 CLI`](https://github.com/PowerShell/DSC) - For enhanced performance and better error handling + - Available via Microsoft Store: `ms-appinstaller://DSC` + - Or download from GitHub releases + - Supports improved configuration validation and structured output + +### Version Requirements +- **WinGet**: Version 1.7.10661 or later +- **PowerShell**: Version 5.1 or later (PowerShell 7+ recommended for DSC v3) +- **Windows**: Windows 10 version 1809 or later, Windows 11 recommended + +> **Note**: The setup script will automatically detect which tools are available and use the appropriate method to apply configurations. ## How to contribute diff --git a/configurations-dscv2-backup/.vsconfig b/configurations-dscv2-backup/.vsconfig new file mode 100644 index 0000000..c432017 --- /dev/null +++ b/configurations-dscv2-backup/.vsconfig @@ -0,0 +1,147 @@ +{ + "version": "1.0", + "components": [ + "Component.Xamarin", + "Microsoft.VisualStudio.Component.Roslyn.Compiler", + "Microsoft.Component.MSBuild", + "Microsoft.VisualStudio.Component.Roslyn.LanguageServices", + "Microsoft.VisualStudio.Component.MSODBC.SQL", + "Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils", + "Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime", + "Microsoft.VisualStudio.Component.SQL.CLR", + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.Net.Component.4.8.SDK", + "Microsoft.Net.Component.4.7.2.TargetingPack", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.VisualStudio.Component.TypeScript.TSServer", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", + "Microsoft.VisualStudio.Component.JavaScript.TypeScript", + "Microsoft.VisualStudio.Component.JavaScript.Diagnostics", + "Microsoft.VisualStudio.Component.TextTemplating", + "Component.Microsoft.VisualStudio.RazorExtension", + "Microsoft.VisualStudio.Component.IISExpress", + "Microsoft.VisualStudio.Component.NuGet", + "Microsoft.VisualStudio.Component.Common.Azure.Tools", + "Microsoft.Component.ClickOnce", + "Microsoft.VisualStudio.Component.ManagedDesktop.Core", + "Microsoft.VisualStudio.Component.SQL.SSDT", + "Microsoft.VisualStudio.Component.SQL.DataSources", + "Component.Microsoft.Web.LibraryManager", + "Component.Microsoft.WebTools.BrowserLink.WebLivePreview", + "Microsoft.VisualStudio.ComponentGroup.Web", + "Microsoft.NetCore.Component.Runtime.8.0", + "Microsoft.NetCore.Component.SDK", + "Microsoft.VisualStudio.Component.FSharp", + "Microsoft.ComponentGroup.ClickOnce.Publish", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.VisualStudio.Component.FSharp.WebTemplates", + "Microsoft.VisualStudio.Component.DockerTools", + "Microsoft.NetCore.Component.Web", + "Microsoft.VisualStudio.Component.WebDeploy", + "Microsoft.VisualStudio.Component.AppInsights.Tools", + "Microsoft.VisualStudio.Component.Web", + "Microsoft.Net.Component.4.8.TargetingPack", + "Microsoft.Net.ComponentGroup.4.8.DeveloperTools", + "Microsoft.VisualStudio.Component.AspNet45", + "Microsoft.VisualStudio.Component.AspNet", + "Component.Microsoft.VisualStudio.Web.AzureFunctions", + "Microsoft.VisualStudio.ComponentGroup.AzureFunctions", + "Microsoft.VisualStudio.Component.Debugger.Snapshot", + "Microsoft.VisualStudio.ComponentGroup.Web.CloudTools", + "Microsoft.VisualStudio.Component.IntelliTrace.FrontEnd", + "Microsoft.VisualStudio.Component.DiagnosticTools", + "Microsoft.VisualStudio.Component.EntityFramework", + "Microsoft.VisualStudio.Component.LiveUnitTesting", + "Microsoft.VisualStudio.Component.Debugger.JustInTime", + "Component.Microsoft.VisualStudio.LiveShare.2022", + "Microsoft.VisualStudio.Component.WslDebugging", + "Microsoft.VisualStudio.Component.IntelliCode", + "Microsoft.NetCore.Component.Runtime.6.0", + "microsoft.net.runtime.mono.tooling", + "microsoft.net.runtime.mono.tooling.net7", + "microsoft.net.runtime.mono.tooling.net6", + "Microsoft.Net.Component.4.8.1.SDK", + "Microsoft.Net.Component.4.8.1.TargetingPack", + "Microsoft.VisualStudio.Component.GraphDocument", + "Microsoft.VisualStudio.Workload.NetWeb", + "Microsoft.VisualStudio.Component.Azure.ClientLibs", + "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", + "Microsoft.Component.Azure.DataLake.Tools", + "Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools", + "Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools", + "Microsoft.VisualStudio.Component.Azure.AuthoringTools", + "Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools", + "Microsoft.VisualStudio.Component.Azure.Compute.Emulator", + "Microsoft.VisualStudio.Component.Azure.Waverton", + "Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices", + "Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools", + "Microsoft.VisualStudio.Component.Azure.Powershell", + "Microsoft.VisualStudio.Workload.Azure", + "Microsoft.Component.PythonTools", + "Microsoft.VisualStudio.Component.VC.CoreIde", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.Graphics.Tools", + "Microsoft.VisualStudio.Component.VC.DiagnosticTools", + "Microsoft.VisualStudio.Component.Windows11SDK.22621", + "Microsoft.VisualStudio.Workload.Python", + "maui.core", + "maui.blazor", + "microsoft.net.runtime.android.net7", + "microsoft.net.runtime.android.aot.net7", + "microsoft.net.runtime.android", + "microsoft.net.runtime.android.aot", + "android", + "Component.OpenJDK", + "Microsoft.VisualStudio.Component.MonoDebugger", + "Microsoft.VisualStudio.Component.Merq", + "Microsoft.VisualStudio.ComponentGroup.Maui.Android", + "runtimes.ios", + "microsoft.net.runtime.ios", + "runtimes.ios.net7", + "microsoft.net.runtime.ios.net7", + "ios", + "Component.Xamarin.RemotedSimulator", + "Microsoft.VisualStudio.ComponentGroup.Maui.iOS", + "runtimes.maccatalyst", + "microsoft.net.runtime.maccatalyst", + "runtimes.maccatalyst.net7", + "microsoft.net.runtime.maccatalyst.net7", + "maccatalyst", + "Microsoft.VisualStudio.ComponentGroup.Maui.MacCatalyst", + "maui.windows", + "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", + "Microsoft.VisualStudio.ComponentGroup.Maui.Windows", + "Microsoft.VisualStudio.ComponentGroup.Maui.Blazor", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", + "Microsoft.VisualStudio.ComponentGroup.Maui.Shared", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK.MAUI", + "Microsoft.VisualStudio.Workload.NetCrossPlat", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.VisualStudio.Component.DotNetModelBuilder", + "Microsoft.ComponentGroup.Blend", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", + "Microsoft.VisualStudio.Component.Windows10SDK.19041", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64EC", + "Microsoft.VisualStudio.Component.UWP.VC.ARM64EC", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", + "Microsoft.VisualStudio.Component.UWP.VC.ARM64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM", + "Microsoft.VisualStudio.ComponentGroup.UWP.VC", + "Microsoft.Component.NetFX.Native", + "Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard", + "Microsoft.VisualStudio.Component.Graphics", + "Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin", + "Microsoft.VisualStudio.ComponentGroup.UWP.Support", + "Microsoft.VisualStudio.Workload.Universal", + "Microsoft.VisualStudio.Workload.Data", + "Component.MDD.Linux", + "Component.Linux.CMake", + "Microsoft.VisualStudio.Workload.NativeCrossPlat", + "Microsoft.NetCore.Component.Runtime.7.0", + "Microsoft.VisualStudio.Component.VisualStudioData" + ], + "extensions": [] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/3d-printing-configuration-vscode-extensions.json b/configurations-dscv2-backup/3d-printing-configuration-vscode-extensions.json new file mode 100644 index 0000000..f353267 --- /dev/null +++ b/configurations-dscv2-backup/3d-printing-configuration-vscode-extensions.json @@ -0,0 +1,6 @@ +{ + "extensions": + [ + { "name": "Antyos.openscad", "description": "OpenSCAD highlighting, snippets, and more for VSCode" } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/3d-printing-configuration.dsc.yaml b/configurations-dscv2-backup/3d-printing-configuration.dsc.yaml new file mode 100644 index 0000000..63f7a05 --- /dev/null +++ b/configurations-dscv2-backup/3d-printing-configuration.dsc.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with 3d printing # +# NOTE: Run: winget configure .\3d-printing-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\3d-printing-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\3d-printing-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/ai-configuration-vscode-extensions.json b/configurations-dscv2-backup/ai-configuration-vscode-extensions.json new file mode 100644 index 0000000..8a73f97 --- /dev/null +++ b/configurations-dscv2-backup/ai-configuration-vscode-extensions.json @@ -0,0 +1,9 @@ +{ + "extensions": + [ + { "name": "ms-semantic-kernel.semantic-kernel", "description": "Prompt engineering tools to create AI plugins with Semantic Kernel" }, + { "name": "ms-windows-ai-studio.windows-ai-studio", "description": "AI Toolkit for Visual Studio Code simplifies generative AI app development by bringing together cutting-edge AI development tools and models from Azure AI Studio Catalog and other catalogs like Hugging Face." }, + { "name": "prompt-flow.prompt-flow", "description": "Prompt flow is a suite of development tools designed to streamline the end-to-end development cycle of LLM-based AI applications, from ideation, prototyping, testing, evaluation to production deployment and monitoring. It makes prompt engineering much easier and enables you to build LLM apps with production quality." }, + { "name": "ms-toolsai.prompty", "description": "Prompty is an asset class and format for LLM prompts designed to enhance observability, understandability, and portability for developers. The primary goal is to accelerate the developer inner loop." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/ai-configuration.dsc.yaml b/configurations-dscv2-backup/ai-configuration.dsc.yaml new file mode 100644 index 0000000..2a7bc19 --- /dev/null +++ b/configurations-dscv2-backup/ai-configuration.dsc.yaml @@ -0,0 +1,77 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing AI Applications # +# NOTE: Run: winget configure .\ai-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Ollama + directives: + description: Install Ollama + allowPrerelease: true + settings: + id: "Ollama.Ollama" + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: LMStudio + directives: + description: Install LMStudio + allowPrerelease: true + settings: + id: "LMStudio.LMStudio" + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\ai-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\ai-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/azure-configuration-vscode-extensions.json b/configurations-dscv2-backup/azure-configuration-vscode-extensions.json new file mode 100644 index 0000000..5b78cdd --- /dev/null +++ b/configurations-dscv2-backup/azure-configuration-vscode-extensions.json @@ -0,0 +1,34 @@ +{ + "extensions": + [ + { "name": "AzureADB2CTools.aadb2c", "description": "Azure AD B2C custom policy extension" }, + { "name": "Azurite.azurite", "description": "An open source Azure Storage API compatible server" }, + { "name": "bencoleman.armview", "description": "Graphically display ARM templates in an interactive map view" }, + { "name": "ms-azure-devops.azure-pipelines", "description": "Syntax highlighting, IntelliSense, and more for Azure Pipelines YAML" }, + { "name": "ms-azuretools.azure-dev", "description": "Makes it easy to run, provision, and deploy Azure applications using the Azure Developer CLI" }, + { "name": "ms-azuretools.rad-vscode-bicep", "description": "Radius custom Bicep language support for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-apimanagement", "description": "An Azure API Management extension for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-azureappservice", "description": "An Azure App Service management extension for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-azurecontainerapps", "description": "An Azure Container Apps extension for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-azurefunctions", "description": "An Azure Functions extension for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-azureresourcegroups", "description": "An extension for viewing and managing Azure resources" }, + { "name": "ms-azuretools.vscode-azurestaticwebapps", "description": "An Azure Static Web Apps extension for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-azurestorage", "description": "Manage your Azure Storage accounts including Blob Containers, File Shares, Tables and Queues" }, + { "name": "ms-azuretools.vscode-azurevirtualmachines", "description": "An Azure Virtual Machines extension for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-azure-github-copilot", "description": "GitHub Copilot for Azure is the @azure extension. It's designed to help streamline the process of developing for Azure. You can ask @azure questions about Azure services or get help with tasks related to Azure and developing for Azure, all from within Visual Studio Code." }, + { "name": "ms-azuretools.vscode-bicep", "description": "Bicep language support for Visual Studio Code" }, + { "name": "ms-azuretools.vscode-cosmosdb", "description": "Create, browse, and update globally distributed, multi-model databases in Azure" }, + { "name": "ms-azuretools.ms-entra", "description": "Add authentication to applications for customer identity and access management (CIAM) scenarios" }, + { "name": "ms-mssql.sql-bindings-vscode", "description": "Enables users to develop and publish Azure Functions with Azure SQL bindings" }, + { "name": "ms-vscode.azure-account", "description": "A common Sign In and Subscription management extension for VS Code" }, + { "name": "ms-vscode.azurecli", "description": "Tools for developing and running commands of the Azure CLI" }, + { "name": "ms-vscode.vscode-node-azure-pack", "description": "Get web site hosting, SQL and MongoDB data, Docker Containers, Serverless Functions" }, + { "name": "msazurermtools.azurerm-vscode-tools", "description": "Language server, editing tools and snippets for Azure Resource Manager (ARM) template files" }, + { "name": "SavranWeb.cosmosdbsqlapi", "description": "Query Azure Cosmos DB SQL API. Includes Execution Metrics and Indexig Policies" }, + { "name": "Summer.azure-event-hub-explorer", "description": "Manage Azure Event Hub and Messages with Visual Studio Code" }, + { "name": "VisualStudioOnlineApplicationInsights.application-insights", "description": "" }, + { "name": "vsciot-vscode.azure-iot-edge", "description": "Azure IoT Edge extension makes it easy to code, build, deploy, and debug your IoT Edge solutions in Visual Studio Code" }, + { "name": "vsciot-vscode.azure-iot-toolkit", "description": "Interact with Azure IoT Hub, IoT Device Management, IoT Edge Management, IoT Hub Device Simulation, IoT Hub Code Generation and IoT Hub Device Provisioning Service" }, + { "name": "vsciot-vscode.vscode-dtdl", "description": "This extension provides syntax highlighting to read and edit JSON documents using the Digital Twins Definition Language" } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/azure-configuration.dsc.yaml b/configurations-dscv2-backup/azure-configuration.dsc.yaml new file mode 100644 index 0000000..df9561b --- /dev/null +++ b/configurations-dscv2-backup/azure-configuration.dsc.yaml @@ -0,0 +1,109 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing in azure # +# NOTE: Run: winget configure .\azure-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: AzureCLI + directives: + description: Install Azure CLI + allowPrerelease: true + settings: + id: Microsoft.AzureCLI + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: AzureCosmosDbEmulator + directives: + description: Install Azure Cosmos DB Emulator + allowPrerelease: true + settings: + id: Microsoft.Azure.CosmosEmulator + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: AzureDeveloperCLI + directives: + description: Install Azure Developer CLI + allowPrerelease: true + settings: + id: microsoft.azd + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: AzureFunctionsCoreTools + directives: + description: Install Azure Functions CoreTools + allowPrerelease: true + settings: + id: Microsoft.Azure.FunctionsCoreTools + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: AzureStorageExplorer + directives: + description: Install Azure Storage Explorer + allowPrerelease: true + settings: + id: Microsoft.Azure.StorageExplorer + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: BicepCLI + directives: + description: Install Bicep CLI + allowPrerelease: true + settings: + id: Microsoft.Bicep + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\azure-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\azure-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/c-cplusplus-configuration-vscode-extensions.json b/configurations-dscv2-backup/c-cplusplus-configuration-vscode-extensions.json new file mode 100644 index 0000000..57b0679 --- /dev/null +++ b/configurations-dscv2-backup/c-cplusplus-configuration-vscode-extensions.json @@ -0,0 +1,10 @@ +{ + "extensions": + [ + { "name": "ms-vscode.cmake-tools", "description": "Extended CMake support in Visual Studio Code" }, + { "name": "ms-vscode.cpptools", "description": "C/C++ IntelliSense, debugging, and code browsing" }, + { "name": "ms-vscode.cpptools-extension-pack", "description": "Popular extensions for C++ development in Visual Studio Code" }, + { "name": "ms-vscode.cpptools-themes", "description": "UI Themes for C/C++ extension" }, + { "name": "twxs.cmake", "description": "CMake langage support for Visual Studio Code" } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/c-cplusplus-configuration.dsc.yaml b/configurations-dscv2-backup/c-cplusplus-configuration.dsc.yaml new file mode 100644 index 0000000..c042c22 --- /dev/null +++ b/configurations-dscv2-backup/c-cplusplus-configuration.dsc.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing in C/C++ # +# NOTE: Run: winget configure .\c-cplusplus-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\c-cplusplus-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\c-cplusplus-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/configuration-vscode-extensions.json b/configurations-dscv2-backup/configuration-vscode-extensions.json new file mode 100644 index 0000000..96e48cd --- /dev/null +++ b/configurations-dscv2-backup/configuration-vscode-extensions.json @@ -0,0 +1,29 @@ +{ + "extensions": + [ + { "name": "AykutSarac.jsoncrack-vscode", "description": "Seamlessly visualize your JSON data instantly into graphs" }, + { "name": "christian-kohler.path-intellisense", "description": "Visual Studio Code plugin that auto completes filenames" }, + { "name": "Davidsekar.redis-xplorer", "description": "Connect to multiple Redis servers simultaneously (TLS supported). Perform simple read, write & filter keys operations with ease" }, + { "name": "eamodio.gitlens", "description": "Supercharge Git within VS Code" }, + { "name": "EditorConfig.EditorConfig", "description": "EditorConfig Support for Visual Studio Code" }, + { "name": "esbenp.prettier-vscode", "description": "Code formatter using prettier" }, + { "name": "formulahendry.github-actions", "description": "Language support for workflow file of GitHub Actions" }, + { "name": "GitHub.copilot", "description": "Your AI pair programmer" }, + { "name": "GitHub.copilot-chat", "description": "AI chat features powered by Copilot" }, + { "name": "github.vscode-github-actions", "description": "GitHub Actions workflows and runs for github.com hosted repositories in VS Code" }, + { "name": "johnpapa.vscode-cloak", "description": "Cloak hides/shows your secrets in environment files, to avoid accidentally sharing them with everyone who sees your screen" }, + { "name": "mikestead.dotenv", "description": "Support for dotenv file syntax" }, + { "name": "mindaro-dev.file-downloader", "description": "Exposes an API that allows other extensions to download files" }, + { "name": "ms-vscode.js-debug", "description": "An extension for debugging Node.js programs and Chrome" }, + { "name": "ms-vscode.powershell", "description": "Develop PowerShell modules, commands and scripts in Visual Studio Code" }, + { "name": "MS-vsliveshare.vsliveshare", "description": "Real-time collaborative development from the comfort of your favorite tools" }, + { "name": "PKief.material-icon-theme", "description": "Material Design Icons for Visual Studio Code" }, + { "name": "redhat.vscode-yaml", "description": "YAML Language Support by Red Hat, with built-in Kubernetes syntax support" }, + { "name": "shardulm94.trailing-spaces", "description": "Highlight trailing spaces and delete them in a flash" }, + { "name": "SonarSource.sonarlint-vscode", "description": "Linter to detect & fix coding issues locally in JS/TS, Python, PHP, Java, C, C++, C#, Go, IaC" }, + { "name": "streetsidesoftware.code-spell-checker", "description": "Spelling checker for source code" }, + { "name": "VisualStudioExptTeam.intellicode-api-usage-examples", "description": "See relevant code examples from GitHub for over 100K different APIs right in your editor" }, + { "name": "VisualStudioExptTeam.vscodeintellicode", "description": "AI-assisted development" }, + { "name": "VisualStudioExptTeam.vscodeintellicode-completions", "description": "IntelliCode Completions: AI-driven code auto-completion" } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/configuration.dsc.yaml b/configurations-dscv2-backup/configuration.dsc.yaml new file mode 100644 index 0000000..e27eedb --- /dev/null +++ b/configurations-dscv2-backup/configuration.dsc.yaml @@ -0,0 +1,191 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing in dotnet on Windows 11 # +# NOTE: Run: winget configure .\configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: 7Zip + directives: + description: Install 7Zip + allowPrerelease: true + settings: + id: "7zip.7zip" + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: FiddlerClassic + directives: + description: Install Telerik Fiddler Classic + allowPrerelease: true + settings: + id: Telerik.Fiddler.Classic + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Fork + directives: + description: Install fork + allowPrerelease: true + settings: + id: Fork.Fork + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Git + directives: + description: Install Git + allowPrerelease: true + settings: + id: Git.Git + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: GitHubClI + directives: + description: Install GitHub Cli + allowPrerelease: true + settings: + id: GitHub.cli + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: GoogleChrome + directives: + description: Install Google Chrome + allowPrerelease: true + settings: + id: Google.Chrome + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Jq + directives: + description: Install jq + allowPrerelease: true + settings: + id: jqlang.jq + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: NodeJs + directives: + description: Install NodeJS + allowPrerelease: true + settings: + id: OpenJS.NodeJS.LTS + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: NotepadPlusPlus + directives: + description: Install Notepad++ + allowPrerelease: true + settings: + id: Notepad++.Notepad++ + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: NugetPackageExplorer + directives: + description: Nuget Package Explorer + allowPrerelease: true + settings: + id: "9WZDNCRDMDM3" + source: msstore + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: PowerShell7 + directives: + description: Install PowerShell 7 + allowPrerelease: true + settings: + id: Microsoft.PowerShell + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Slack + directives: + description: Install Slack + allowPrerelease: true + settings: + id: SlackTechnologies.Slack + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: TortoiseGit + directives: + description: Install TortoiseGit + allowPrerelease: true + settings: + id: TortoiseGit.TortoiseGit + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Ubuntu2204 + directives: + description: Ubuntu 22.04 LTS + allowPrerelease: true + settings: + id: Canonical.Ubuntu.2204 + source: winget + dependsOn: + - Wsl + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: WinMerge + directives: + description: Install WinMerge + allowPrerelease: true + settings: + id: WinMerge.WinMerge + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Wsl + directives: + description: Install Windows Subsystem for Linux + allowPrerelease: true + settings: + id: "9P9TQF7MRM4R" + source: msstore \ No newline at end of file diff --git a/configurations-dscv2-backup/container-configuration-vscode-extensions.json b/configurations-dscv2-backup/container-configuration-vscode-extensions.json new file mode 100644 index 0000000..741e794 --- /dev/null +++ b/configurations-dscv2-backup/container-configuration-vscode-extensions.json @@ -0,0 +1,11 @@ +{ + "extensions": + [ + { "name": "ipedrazas.kubernetes-snippets", "description": "Provides a collection of code snippets for Kubernetes resources, making it easier to write Kubernetes configuration files" }, + { "name": "mindaro.mindaro", "description": "Enables developers to run and debug their applications directly in Kubernetes clusters from VS Code, simplifying microservices development and testing" }, + { "name": "ms-azuretools.vscode-docker", "description": "Makes it easy to build, manage, and deploy containerized applications from Visual Studio Code using Docker" }, + { "name": "ms-kubernetes-tools.vscode-aks-tools", "description": "Provides integration with Azure Kubernetes Service (AKS), allowing users to browse AKS clusters and manage AKS resources within VS Code" }, + { "name": "ms-kubernetes-tools.vscode-kubernetes-tools", "description": "Offers comprehensive Kubernetes integration, including cluster management, resource navigation, logs streaming, and terminal access to Kubernetes environments" }, + { "name": "ms-vscode-remote.remote-containers", "description": "Allows you to open any folder inside (or mounted into) a container and take advantage of VS Code's full feature set as if you were working locally" } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/container-configuration.dsc.yaml b/configurations-dscv2-backup/container-configuration.dsc.yaml new file mode 100644 index 0000000..11c88e3 --- /dev/null +++ b/configurations-dscv2-backup/container-configuration.dsc.yaml @@ -0,0 +1,69 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with containers # +# NOTE: Run: winget configure .\container-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Docker + directives: + description: Install Docker + allowPrerelease: true + settings: + id: Docker.DockerDesktop + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\container-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\container-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/data-configuration-vscode-extensions.json b/configurations-dscv2-backup/data-configuration-vscode-extensions.json new file mode 100644 index 0000000..c04b8c4 --- /dev/null +++ b/configurations-dscv2-backup/data-configuration-vscode-extensions.json @@ -0,0 +1,15 @@ +{ + "extensions": + [ + { "name": "dvirtz.parquet-viewer", "description": "Allows users to view Apache Parquet files directly within Visual Studio Code, providing an easy way to inspect large data files without leaving the editor." }, + { "name": "ms-mssql.data-workspace-vscode", "description": "Provides a unified data project management experience in VS Code, enabling users to organize and manage database projects and data connections." }, + { "name": "ms-mssql.mssql", "description": "Enables database development directly from VS Code, allowing you to connect to SQL Server, Azure SQL Database, and SQL Data Warehouse, and run queries." }, + { "name": "ms-mssql.sql-database-projects-vscode", "description": "Supports SQL database project management and development, facilitating source control integration and an organized approach to database development." }, + { "name": "ms-toolsai.jupyter", "description": "Integrates Jupyter Notebook support into VS Code, allowing you to create, edit, and run Jupyter notebooks within the editor." }, + { "name": "ms-toolsai.jupyter-keymap", "description": "Provides Jupyter Notebook keymap extensions for VS Code, enabling familiar keyboard shortcuts for those accustomed to Jupyter's interface." }, + { "name": "ms-toolsai.jupyter-renderers", "description": "Adds additional output renderers for Jupyter notebooks in VS Code, enhancing the visualization of notebook outputs." }, + { "name": "ms-toolsai.vscode-jupyter-cell-tags", "description": "Allows users to add, edit, and manage tags on Jupyter notebook cells directly within VS Code, improving notebook organization and navigation." }, + { "name": "ms-toolsai.vscode-jupyter-slideshow", "description": "Enables the creation of slide shows from Jupyter notebooks within VS Code, facilitating presentations and educational content creation." }, + { "name": "paiqo.databricks-vscode", "description": "Provides seamless integration with Databricks, allowing you to develop and deploy Databricks notebooks, jobs, and workflows directly from VS Code." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/data-configuration.dsc.yaml b/configurations-dscv2-backup/data-configuration.dsc.yaml new file mode 100644 index 0000000..59d9b60 --- /dev/null +++ b/configurations-dscv2-backup/data-configuration.dsc.yaml @@ -0,0 +1,77 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with data # +# NOTE: Run: winget configure .\data-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: SQLServerManagementStudio + directives: + description: Install SSMS - SQL Server Management Studio + allowPrerelease: true + settings: + id: Microsoft.SQLServerManagementStudio + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: AzureDataStudio + directives: + description: Install Azure DataStudio + allowPrerelease: true + settings: + id: Microsoft.AzureDataStudio + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\data-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\data-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/documentation-configuration-vscode-extensions.json b/configurations-dscv2-backup/documentation-configuration-vscode-extensions.json new file mode 100644 index 0000000..12872ef --- /dev/null +++ b/configurations-dscv2-backup/documentation-configuration-vscode-extensions.json @@ -0,0 +1,12 @@ +{ + "extensions": + [ + { "name": "aaron-bond.better-comments", "description": "Improves code commenting by categorizing them into alerts, queries, TODOs, and more, making them more readable and noticeable." }, + { "name": "bierner.markdown-mermaid", "description": "Enables the integration of Mermaid diagrams in Markdown files within VS Code, allowing for the creation of diagrams using text and code." }, + { "name": "bpruitt-goddard.mermaid-markdown-syntax-highlighting", "description": "Provides syntax highlighting for Mermaid code blocks within Markdown files, enhancing readability and editing of diagrams." }, + { "name": "DavidAnson.vscode-markdownlint", "description": "A linter for Markdown files, helping ensure consistency and adherence to Markdown best practices and style guidelines." }, + { "name": "hediet.vscode-drawio", "description": "Integrates draw.io into VS Code, offering a powerful diagramming and drawing tool within the editor for creating complex diagrams." }, + { "name": "mdickin.markdown-shortcuts", "description": "Adds handy keyboard shortcuts for editing Markdown files more efficiently, improving productivity for Markdown documentation." }, + { "name": "yzhang.markdown-all-in-one", "description": "Provides a comprehensive set of features for Markdown editing, including keyboard shortcuts, table of contents, auto preview, and more." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/documentation-configuration.dsc.yaml b/configurations-dscv2-backup/documentation-configuration.dsc.yaml new file mode 100644 index 0000000..225ca9f --- /dev/null +++ b/configurations-dscv2-backup/documentation-configuration.dsc.yaml @@ -0,0 +1,69 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with documentation # +# NOTE: Run: winget configure .\documentation-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: DiagramsNet + directives: + description: Install Diagrams.Net + allowPrerelease: true + settings: + id: JGraph.Draw + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\documentation-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\documentation-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/dotnet-configuration-vscode-extensions.json b/configurations-dscv2-backup/dotnet-configuration-vscode-extensions.json new file mode 100644 index 0000000..3d38b5b --- /dev/null +++ b/configurations-dscv2-backup/dotnet-configuration-vscode-extensions.json @@ -0,0 +1,14 @@ +{ + "extensions": + [ + { "name": "formulahendry.dotnet", "description": "Provides .NET Core support for VS Code, including project creation, running, and debugging functionalities." }, + { "name": "formulahendry.dotnet-test-explorer", "description": "Adds test explorer support for .NET Core, making it easier to run and debug tests directly from VS Code." }, + { "name": "ms-dotnettools.blazorwasm-companion", "description": "Facilitates the development of Blazor WebAssembly applications by enabling debugging capabilities directly in the browser from VS Code." }, + { "name": "ms-dotnettools.csdevkit", "description": "Enhances C# development in VS Code with additional tools and utilities, aimed at improving productivity and efficiency." }, + { "name": "ms-dotnettools.csharp", "description": "Provides rich C# language support, including features such as IntelliSense, debugging, and code navigation in VS Code." }, + { "name": "ms-dotnettools.dotnet-interactive-vscode", "description": "Enables .NET Interactive Notebooks in VS Code, allowing the execution of .NET code in an interactive notebook environment." }, + { "name": "ms-dotnettools.dotnet-maui", "description": "Supports the development of .NET MAUI (Multi-platform App UI) projects, offering tools for building cross-platform applications." }, + { "name": "ms-dotnettools.vscode-dotnet-runtime", "description": "Automates the acquisition and management of the .NET runtime, simplifying the setup process for projects that require the .NET runtime." }, + { "name": "ms-dotnettools.vscodeintellicode-csharp", "description": "Integrates AI-assisted IntelliCode for C# in VS Code, providing more context-aware code completions based on patterns found in your code and others." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/dotnet-configuration.dsc.yaml b/configurations-dscv2-backup/dotnet-configuration.dsc.yaml new file mode 100644 index 0000000..7a2491e --- /dev/null +++ b/configurations-dscv2-backup/dotnet-configuration.dsc.yaml @@ -0,0 +1,135 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing in dotnet # +# NOTE: Run: winget configure .\dotnet-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: DotNetSDK8 + directives: + description: Install Microsoft .NET SDK 8.0 + allowPrerelease: true + settings: + id: Microsoft.DotNet.SDK.8 + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudio + directives: + description: Install Visual Studio 2022 Enterprise + allowPrerelease: true + settings: + id: Microsoft.VisualStudio.2022.Enterprise + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + directives: + description: Install required VS workloads from project .vsconfig file + allowPrerelease: true + settings: + productId: Microsoft.VisualStudio.Product.Enterprise + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\.vsconfig' + dependsOn: + - VisualStudio + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode + - resource: PSDscResources/Script + id: DotNetTools + directives: + description: Script to manage .NET tools installation + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Load required tools from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-tools-configuration.json' -Raw + $requiredTools = (ConvertFrom-Json $jsonContent).tools.id + + # Get the list of currently installed global tools + $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } + + # Check if all required tools are installed + $allInstalled = $true + foreach ($toolId in $requiredTools) { + if (-not ($installedTools -contains $toolId)) { + $allInstalled = $false + break + } + } + + return $allInstalled + SetScript: | + # Load required tools from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-tools-configuration.json' -Raw + $tools = (ConvertFrom-Json $jsonContent).tools + + # Get the list of currently installed global tools by parsing the first column + $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } + + foreach ($tool in $tools) { + $toolId = $tool.id + $toolVersion = $tool.version + + # Install the tool if it is not already installed + if (-not ($installedTools -contains $toolId)) { + $installCommand = "dotnet tool install -g $toolId" + if ($toolVersion -ne "latest") { + $installCommand += " --version $toolVersion" + } + + Invoke-Expression $installCommand + } + } \ No newline at end of file diff --git a/configurations-dscv2-backup/dotnet-tools-configuration.json b/configurations-dscv2-backup/dotnet-tools-configuration.json new file mode 100644 index 0000000..253dee9 --- /dev/null +++ b/configurations-dscv2-backup/dotnet-tools-configuration.json @@ -0,0 +1,12 @@ +{ + "tools": [ + {"id": "atc-coding-rules-updater", "version": "latest"}, + {"id": "atc-rest-api-generator", "version": "latest"}, + {"id": "verify.tool", "version": "latest"}, + {"id": "dotnet-appcat", "version": "latest"}, + {"id": "csharprepl", "version": "latest"}, + {"id": "dotnet-ef", "version": "latest"}, + {"id": "mlnet-win-x64", "version": "latest"}, + {"id": "powershell", "version": "latest"} + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/embedded-configuration-vscode-extensions.json b/configurations-dscv2-backup/embedded-configuration-vscode-extensions.json new file mode 100644 index 0000000..669d9dd --- /dev/null +++ b/configurations-dscv2-backup/embedded-configuration-vscode-extensions.json @@ -0,0 +1,6 @@ +{ + "extensions": + [ + { "name": "platformio.platformio-ide", "description": "A comprehensive IDE for IoT development that supports cross-platform build system, library management, and full integration with professional development environments. Enables development with multiple platforms, frameworks, and boards." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/embedded-devices-configuration.dsc.yaml b/configurations-dscv2-backup/embedded-devices-configuration.dsc.yaml new file mode 100644 index 0000000..40618f8 --- /dev/null +++ b/configurations-dscv2-backup/embedded-devices-configuration.dsc.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with embedded devices # +# NOTE: Run: winget configure .\embedded-devices-configuration.dsc.yaml --accept-configuration-agreements# +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\embedded-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\embedded-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/game-configuration-vscode-extensions.json b/configurations-dscv2-backup/game-configuration-vscode-extensions.json new file mode 100644 index 0000000..855d1e7 --- /dev/null +++ b/configurations-dscv2-backup/game-configuration-vscode-extensions.json @@ -0,0 +1,6 @@ +{ + "extensions": + [ + { "name": "VisualStudioToolsForUnity.vstuc", "description": "Integrates Visual Studio Code with Unity" } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/game-configuration.dsc.yaml b/configurations-dscv2-backup/game-configuration.dsc.yaml new file mode 100644 index 0000000..108df27 --- /dev/null +++ b/configurations-dscv2-backup/game-configuration.dsc.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing games # +# NOTE: Run: winget configure .\game-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\game-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\game-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/java-configuration-vscode-extensions.json b/configurations-dscv2-backup/java-configuration-vscode-extensions.json new file mode 100644 index 0000000..e1dc54b --- /dev/null +++ b/configurations-dscv2-backup/java-configuration-vscode-extensions.json @@ -0,0 +1,11 @@ +{ + "extensions": + [ + { "name": "redhat.java", "description": "Provides Java language support via Eclipse JDT Language Server, which utilizes Eclipse JDT, M2Eclipse and Buildship to allow for a rich Java development experience." }, + { "name": "vscjava.vscode-java-debug", "description": "Offers powerful debugging support for Java applications, including launch/attach configurations, breakpoints, step through, variables inspection, and expression evaluation." }, + { "name": "vscjava.vscode-java-dependency", "description": "Views and manages project dependencies directly in Visual Studio Code, enhancing Java project management and navigation capabilities." }, + { "name": "vscjava.vscode-java-pack", "description": "A collection of essential Java extensions to support Java development, including editing, debugging, testing, and project management." }, + { "name": "vscjava.vscode-java-test", "description": "Provides support for running and debugging JUnit and TestNG test cases, making it easier to perform test-driven development in Java." }, + { "name": "vscjava.vscode-maven", "description": "Integrates Maven into Visual Studio Code, offering features like project creation, dependency management, and custom Maven goals execution." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/java-configuration.dsc.yaml b/configurations-dscv2-backup/java-configuration.dsc.yaml new file mode 100644 index 0000000..f47edef --- /dev/null +++ b/configurations-dscv2-backup/java-configuration.dsc.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing in java # +# NOTE: Run: winget configure .\java-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\java-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\java-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/os-configuration.dsc.yaml b/configurations-dscv2-backup/os-configuration.dsc.yaml new file mode 100644 index 0000000..9ebb2f1 --- /dev/null +++ b/configurations-dscv2-backup/os-configuration.dsc.yaml @@ -0,0 +1,65 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will configure various windows settings on Windows 11 # +# NOTE: Run: winget configure .\os-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + assertions: + - resource: Microsoft.Windows.Developer/OsVersion + id: osVersionAssertion + directives: + description: Verify min OS version requirement + allowPrerelease: true + settings: + MinVersion: '10.0.22631' + resources: + - resource: Microsoft.Windows.Developer/DeveloperMode + id: developerMode + directives: + description: Enable Developer Mode + allowPrerelease: true + settings: + Ensure: Present + dependsOn: + - osVersionAssertion + - resource: Microsoft.Windows.Developer/ShowHiddenFiles + id: showHiddenFiles + directives: + description: Show hidden files + allowPrerelease: true + settings: + Ensure: Present # Ensuring Hidden files are shown + dependsOn: + - osVersionAssertion + - resource: Microsoft.Windows.Developer/HideFileExtensions + id: hideFileExtensions + directives: + description: Show file extensions + allowPrerelease: true + settings: + Ensure: Absent # Ensuring FileExtensions are shown (disables that they should be hidden) + dependsOn: + - osVersionAssertion + - resource: Microsoft.Windows.Developer/EnableDarkMode + id: enableDarkMode + directives: + description: Enable dark mode + allowPrerelease: true + settings: + Ensure: Present + # Use caution when setting `RestartExplorer: true` as this will force explorer to close. + RestartExplorer: true # Required to apply changes + dependsOn: + - osVersionAssertion + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Flux + directives: + description: Install f.lux + allowPrerelease: true + settings: + id: flux.flux + source: winget + dependsOn: + - osVersionAssertion \ No newline at end of file diff --git a/configurations-dscv2-backup/python-configuration-vscode-extensions.json b/configurations-dscv2-backup/python-configuration-vscode-extensions.json new file mode 100644 index 0000000..3f198db --- /dev/null +++ b/configurations-dscv2-backup/python-configuration-vscode-extensions.json @@ -0,0 +1,8 @@ +{ + "extensions": + [ + { "name": "ms-python.isort", "description": "Integrates the isort tool into VS Code for organizing Python imports according to the PEP 8 guidelines, making code structure cleaner and more readable." }, + { "name": "ms-python.python", "description": "Provides comprehensive Python language support in Visual Studio Code, including features such as IntelliSense, linting, debugging, code navigation, code formatting, Jupyter notebook support, refactoring, and much more." }, + { "name": "ms-python.vscode-pylance", "description": "Offers fast and rich language support for Python in VS Code, powered by Pyright. It includes features like auto-imports, type information, auto-completion, and more, enhancing Python development productivity and experience." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/python-configuration.dsc.yaml b/configurations-dscv2-backup/python-configuration.dsc.yaml new file mode 100644 index 0000000..6a4fc4c --- /dev/null +++ b/configurations-dscv2-backup/python-configuration.dsc.yaml @@ -0,0 +1,77 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with python # +# NOTE: Run: winget configure .\python-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Python + directives: + description: Install Python + allowPrerelease: true + settings: + id: Python.Python.3.12 + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: PyCharm + directives: + description: Install JetBrains PyCharm Community Edition + allowPrerelease: true + settings: + id: JetBrains.PyCharm.Community + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\python-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\python-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/remoting-configuration-vscode-extensions.json b/configurations-dscv2-backup/remoting-configuration-vscode-extensions.json new file mode 100644 index 0000000..732e196 --- /dev/null +++ b/configurations-dscv2-backup/remoting-configuration-vscode-extensions.json @@ -0,0 +1,10 @@ +{ + "extensions": + [ + { "name": "ms-vscode.remote-explorer", "description": "Provides a UI to easily manage and switch between remote sessions, containers, and WSL instances directly from Visual Studio Code." }, + { "name": "ms-vscode-remote.remote-ssh", "description": "Allows you to use any remote machine with an SSH server as your development environment, enabling you to open folders and edit files on remote machines directly from VS Code." }, + { "name": "ms-vscode-remote.remote-ssh-edit", "description": "Enhances the Remote - SSH extension by enabling editing and managing configurations of SSH hosts, simplifying the setup process for SSH-based development environments." }, + { "name": "ms-vscode-remote.remote-server", "description": "Acts as a support extension for other Remote Development extensions, enabling VS Code to connect to and work with remote servers." }, + { "name": "ms-vscode-remote.vscode-remote-extensionpack", "description": "A comprehensive pack of extensions for remote development, bundling Remote - SSH, Remote - Containers, and Remote - WSL to support development in containers, on remote machines, or with the Windows Subsystem for Linux." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/remoting-configuration.dsc.yaml b/configurations-dscv2-backup/remoting-configuration.dsc.yaml new file mode 100644 index 0000000..6a8bff5 --- /dev/null +++ b/configurations-dscv2-backup/remoting-configuration.dsc.yaml @@ -0,0 +1,77 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with remoting # +# NOTE: Run: winget configure .\remoting-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: WinSCP + directives: + description: Install WinSCP + allowPrerelease: true + settings: + id: WinSCP.WinSCP + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: PuTTY + directives: + description: Install PuTTY + allowPrerelease: true + settings: + id: PuTTY.PuTTY + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\remoting-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\remoting-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/rest-api-configuration-vscode-extensions.json b/configurations-dscv2-backup/rest-api-configuration-vscode-extensions.json new file mode 100644 index 0000000..127b2f2 --- /dev/null +++ b/configurations-dscv2-backup/rest-api-configuration-vscode-extensions.json @@ -0,0 +1,11 @@ +{ + "extensions": + [ + { "name": "Arjun.swagger-viewer", "description": "Provides a convenient way to view and validate Swagger (OpenAPI) documents directly within Visual Studio Code, offering real-time visualization and error reporting." }, + { "name": "bruno-api-client.bruno", "description": "Bruno is an Opensource IDE for exploring and testing apis. Bruno saves all your request on top of your filesystem in a eloquent domain specific language designed for storing api request data." }, + { "name": "humao.rest-client", "description": "Allows you to send HTTP requests and view the response directly within VS Code, making it easier to test APIs without leaving the editor." }, + { "name": "mermade.openapi-lint", "description": "A linter for OpenAPI specifications that helps ensure your API documents adhere to the OpenAPI standards and best practices, improving API design and documentation." }, + { "name": "ms-graph.kiota", "description": "An experimental extension that provides support for the Kiota SDK, enabling developers to generate API client libraries for Microsoft Graph and other OpenAPI-described APIs directly within VS Code." }, + { "name": "typespec.typespec-vscode", "description": "TypeSpec language support for VS Code"} + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/rest-api-configuration.dsc.yaml b/configurations-dscv2-backup/rest-api-configuration.dsc.yaml new file mode 100644 index 0000000..b07f1ca --- /dev/null +++ b/configurations-dscv2-backup/rest-api-configuration.dsc.yaml @@ -0,0 +1,101 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing with rest-api's # +# NOTE: Run: winget configure .\rest-api-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: k6 + directives: + description: Install k6 load testing + allowPrerelease: true + settings: + id: k6.k6 + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Bruno + directives: + description: Install Bruno + allowPrerelease: true + settings: + id: Bruno.Bruno + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Postman + directives: + description: Install Postman + allowPrerelease: true + settings: + id: Postman.Postman + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: Insomnia + directives: + description: Install Insomnia + allowPrerelease: true + settings: + id: Insomnia.Insomnia + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: StoplightStudio + directives: + description: Install Stoplight Studio + allowPrerelease: true + settings: + id: Stoplight.Studio + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\rest-api-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\rest-api-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations-dscv2-backup/visual-studio-extension-install.ps1 b/configurations-dscv2-backup/visual-studio-extension-install.ps1 new file mode 100644 index 0000000..c1b50fa --- /dev/null +++ b/configurations-dscv2-backup/visual-studio-extension-install.ps1 @@ -0,0 +1,47 @@ +function Install-VSIXExtension { + param ( + [Parameter(Mandatory = $true)] + [string] + $itemName, + + [Parameter(Mandatory = $true)] + [string] + $displayName + ) + + $ErrorActionPreference = "Stop" + $baseHostName = "marketplace.visualstudio.com" + + $uri = "https://$($baseHostName)/items?itemName=$($itemName)" + $vsixLocation = "$($env:Temp)\$([guid]::NewGuid()).vsix" + $vsInstallerServicePath = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service" + + if (-Not $vsInstallerServicePath) { + Write-Error "Visual Studio Installer Service is missing" + Exit 1 + } + + $html = Invoke-WebRequest -Uri $uri -UseBasicParsing -SessionVariable session + $anchor = $html.Links | + Where-Object { $_.class -eq 'install-button-container' } | + Select-Object -ExpandProperty href + + if (-Not $anchor) { + Write-Error "Could not find download anchor tag on the Visual Studio Extensions page for the extension $($displayName)" + Exit 1 + } + + $href = "https://$($baseHostName)$($anchor)" + + Invoke-WebRequest $href -OutFile $vsixLocation -WebSession $session + + if (-Not (Test-Path $vsixLocation)) { + Write-Error "Downloaded VSIX file could not be located for the extension $($displayName)" + Exit 1 + } + + Write-Host "Installing $($displayName)" + Start-Process -Filepath "$($vsInstallerServicePath)\VSIXInstaller" -ArgumentList "/q /a $($vsixLocation)" -Wait + + Remove-Item $vsixLocation +} \ No newline at end of file diff --git a/configurations-dscv2-backup/visual-studio-extensions.ps1 b/configurations-dscv2-backup/visual-studio-extensions.ps1 new file mode 100644 index 0000000..cbbeaac --- /dev/null +++ b/configurations-dscv2-backup/visual-studio-extensions.ps1 @@ -0,0 +1,82 @@ +Start-Transcript -Path "$ENV:temp\logs\VSIXInstaller_$Extension.log" | Out-Null + +$vsInstallationPath = "C:\Program Files (x86)\Microsoft Visual Studio" + +if(!(Get-Item -Path $vsInstallationPath).Exists) +{ + Write-Host "Visual Studio Installation Path not found" + Stop-Transcript | Out-Null + Exit(1) +} + +# import utility function +. "$PSScriptRoot\visual-studio-extension-install.ps1" + +$visualStudioExtensions = @( + @{ DisplayName = 'Add New File'; ItemName = 'MadsKristensen.AddNewFile64'; }, + @{ DisplayName = 'Align Assignments 2022'; ItemName = 'VisualStudioPlatformTeam.AlignAssignment2022'; }, + @{ DisplayName = 'Azure IoT Edge Tools for VS 2022'; ItemName = 'vsc-iot.vs17iotedgetools'; } + @{ DisplayName = 'Azure ServiceBus Monitor for Visual Studio 2022'; ItemName = 'TimVinkemeier.vsservicebusmonitor2022'; }, + @{ DisplayName = 'Azure Migrate application and code assessment'; ItemName = 'ms-dotnettools.appcat'; }, + @{ DisplayName = 'Bicep for Visual Studio'; ItemName = 'ms-azuretools.visualstudiobicep'; }, + @{ DisplayName = 'Bundler & Minifier 2022+'; ItemName = 'Failwyn.BundlerMinifier64'; }, + @{ DisplayName = 'Code Alignment'; ItemName = 'cpmcgrath.Codealignment'; }, + @{ DisplayName = 'CodeMaintainability 2022'; ItemName = 'ognjen-babic.CodeMaintainability2022'; }, + @{ DisplayName = 'Copy As Html 2022'; ItemName = 'VisualStudioPlatformTeam.CopyAsHtml2022'; }, + @{ DisplayName = 'Copy Nice'; ItemName = 'MadsKristensen.CopyNice'; }, + @{ DisplayName = 'Double-Click Maximize 2022'; ItemName = 'VisualStudioPlatformTeam.Double-ClickMaximize2022'; }, + @{ DisplayName = 'Editor Enhancements'; ItemName = 'MadsKristensen.EditorEnhancements'; }, + @{ DisplayName = 'Editor Guidelines'; ItemName = 'VisualStudioPlatformTeam.EditorGuidelines'; }, + @{ DisplayName = 'EF Core Power Tools'; ItemName = 'ErikEJ.EFCorePowerTools'; }, + @{ DisplayName = 'FileDiffer'; ItemName = 'MadsKristensen.FileDiffer'; }, + @{ DisplayName = 'File Icons'; ItemName = 'MadsKristensen.FileIcons'; }, + @{ DisplayName = 'File Explorer'; ItemName = 'MadsKristensen.WorkflowBrowser'; }, + @{ DisplayName = 'Fix Mixed Tabs 2022'; ItemName = 'VisualStudioPlatformTeam.FixMixedTabs2022'; }, + @{ DisplayName = 'GitHub Copilot'; ItemName = 'GitHub.copilotvs'; }, + @{ DisplayName = 'GitHub Copilot Chat'; ItemName = 'VisualStudioExptTeam.VSGitHubCopilot'; }, + @{ DisplayName = 'HTML Snippet Pack'; ItemName = 'MadsKristensen.HTMLSnippetPack'; }, + @{ DisplayName = 'Image Optimizer'; ItemName = 'MadsKristensen.ImageOptimizer64bit'; }, + @{ DisplayName = 'Image Preview'; ItemName = 'MadsKristensen.ImagePreview'; }, + @{ DisplayName = 'Image Sprites'; ItemName = 'MadsKristensen.ImageSprites64'; }, + @{ DisplayName = 'JavaScript Snippet Pack'; ItemName = 'MadsKristensen.JavaScriptSnippetPack'; }, + @{ DisplayName = 'Live Share 2022'; ItemName = 'MS-vsliveshare.vsls-vs-2022'; }, + @{ DisplayName = 'Markdown Editor v2'; ItemName = 'MadsKristensen.MarkdownEditor2'; }, + @{ DisplayName = 'Match Margin 2022'; ItemName = 'VisualStudioPlatformTeam.MatchMargin2022'; }, + @{ DisplayName = 'Microsoft Child Process Debugging Power Tool 2022'; ItemName = 'vsdbgplat.MicrosoftChildProcessDebuggingPowerTool2022'; }, + @{ DisplayName = 'Microsoft Visual Studio Installer Projects 2022 (Preview)'; ItemName = 'VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects'; }, + @{ DisplayName = 'ML.NET Model Builder 2022'; ItemName = 'MLNET.ModelBuilder2022'; }, + @{ DisplayName = 'Middle Click Scroll 2022'; ItemName = 'VisualStudioPlatformTeam.MiddleClickScroll2022'; }, + @{ DisplayName = 'Open Bin Folder'; ItemName = 'coding-with-calvin.OpenBinFolder22'; }, + @{ DisplayName = 'Open Command Line'; ItemName = 'MadsKristensen.OpenCommandLine64'; }, + @{ DisplayName = 'Open in Visual Studio Code'; ItemName = 'MadsKristensen.OpeninVisualStudioCode'; }, + @{ DisplayName = 'NPM Task Runner'; ItemName = 'MadsKristensen.NpmTaskRunner64'; }, + @{ DisplayName = 'NuGetSolver'; ItemName = 'vsext.NuGetSolver'; }, + @{ DisplayName = 'Package Installer'; ItemName = 'MadsKristensen.PackageInstaller64'; }, + @{ DisplayName = 'Peek Help 2022'; ItemName = 'VisualStudioPlatformTeam.PeekHelp2022'; }, + @{ DisplayName = 'PowerShell Tools for Visual Studio 2022'; ItemName = 'AdamRDriscoll.PowerShellToolsVS2022'; }, + @{ DisplayName = 'Productivity Power Tools 2022'; ItemName = 'VisualStudioPlatformTeam.ProductivityPowerPack2022'; }, + @{ DisplayName = 'Rainbow Braces'; ItemName = 'MadsKristensen.RainbowBraces'; }, + @{ DisplayName = 'REST API Client Code Generator for VS 2022'; ItemName = 'ChristianResmaHelle.ApiClientCodeGenerator2022'; }, + @{ DisplayName = 'ResXManager'; ItemName = 'TomEnglert.ResXManager'; }, + @{ DisplayName = 'Scroll Tabs'; ItemName = 'MadsKristensen.ScrollTabs'; }, + @{ DisplayName = 'Shifter'; ItemName = 'MadsKristensen.Shifter'; }, + @{ DisplayName = 'Shrink Empty Lines 2022'; ItemName = 'VisualStudioPlatformTeam.SyntacticLineCompression2022'; }, + @{ DisplayName = 'Solution Error Visualizer 2022'; ItemName = 'VisualStudioPlatformTeam.SolutionErrorVisualizer2022'; }, + @{ DisplayName = 'SQL Formatter'; ItemName = 'MadsKristensen.SqlFormatter'; }, + @{ DisplayName = 'Time Stamp Margin 2022'; ItemName = 'VisualStudioPlatformTeam.TimeStampMargin2022'; }, + @{ DisplayName = 'TypeSpec for Visual Studio'; ItemName = 'typespec.typespecvs'; }, + @{ DisplayName = 'VSColorOutput64'; ItemName = 'MikeWard-AnnArbor.VSColorOutput64'; }, + @{ DisplayName = 'Web Compiler 2022+'; ItemName = 'Failwyn.WebCompiler64'; }, + @{ DisplayName = 'Webpack Task Runner'; ItemName = 'MadsKristensen.WebPackTaskRunner'; }, + @{ DisplayName = 'XAML Styler for Visual Studio 2022'; ItemName = 'TeamXavalon.XAMLStyler2022'; }, + @{ DisplayName = 'Xunit CodeSnippets'; ItemName = 'jsakamoto.xUnitCodeSnippets'; }, + @{ DisplayName = 'ZenCoding'; ItemName = 'MadsKristensen.ZenCoding'; } +) + +foreach ($visualStudioExtension in $visualStudioExtensions) { + Install-VSIXExtension ` + -itemName $visualStudioExtension.ItemName ` + -displayName $visualStudioExtension.DisplayName +} + +Stop-Transcript | Out-Null \ No newline at end of file diff --git a/configurations-dscv2-backup/web-configuration-vscode-extensions.json b/configurations-dscv2-backup/web-configuration-vscode-extensions.json new file mode 100644 index 0000000..3d1b27d --- /dev/null +++ b/configurations-dscv2-backup/web-configuration-vscode-extensions.json @@ -0,0 +1,16 @@ +{ + "extensions": + [ + { "name": "bradlc.vscode-tailwindcss", "description": "Provides Tailwind CSS class name completion, linting, and hover previews in HTML, JavaScript, and other files, enhancing productivity with Tailwind CSS in VS Code." }, + { "name": "christian-kohler.npm-intellisense", "description": "Autocompletes npm modules in import statements, making it easier to reference dependencies without leaving the editor." }, + { "name": "csstools.postcss", "description": "Adds syntax highlighting and IntelliSense for PostCSS, including variables, mixins, and functions, improving the development experience with modern CSS." }, + { "name": "dbaeumer.vscode-eslint", "description": "Integrates ESLint JavaScript linting into VS Code, helping to find and fix problems in JavaScript, TypeScript, and other languages." }, + { "name": "eamodio.gitlens", "description": "Supercharges the built-in VS Code Git capabilities, including advanced blame, branch history, commit searching, and more, enhancing the Git experience." }, + { "name": "eg2.vscode-npm-script", "description": "Provides convenient features for npm scripts, such as validation, running scripts from the editor, and displaying script errors and warnings." }, + { "name": "esbenp.prettier-vscode", "description": "Integrates Prettier, an opinionated code formatter, into VS Code to automatically format JavaScript, TypeScript, CSS, HTML, and more on save or command." }, + { "name": "ms-playwright.playwright", "description": "Supports end-to-end testing with Playwright in VS Code, providing test authoring, execution, and debugging capabilities for web applications." }, + { "name": "wix.vscode-import-cost", "description": "Displays the size of the imported package inline in the editor, helping to understand the impact of adding a new npm package or import to your project." }, + { "name": "yoavbls.pretty-ts-errors", "description": "Enhances TypeScript error messages to make them more readable and easier to understand, improving the TypeScript development experience." }, + { "name": "ZixuanChen.vitest-explorer", "description": "Integrates Vitest into VS Code, providing a test explorer UI that allows you to run and debug Vitest tests directly from the editor." } + ] +} \ No newline at end of file diff --git a/configurations-dscv2-backup/web-configuration.dsc.yaml b/configurations-dscv2-backup/web-configuration.dsc.yaml new file mode 100644 index 0000000..953a10b --- /dev/null +++ b/configurations-dscv2-backup/web-configuration.dsc.yaml @@ -0,0 +1,61 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +########################################################################################################## +# This configuration will install the tools necessary to get started developing web frontends # +# NOTE: Run: winget configure .\web-configuration.dsc.yaml --accept-configuration-agreements # +########################################################################################################## +properties: + configurationVersion: 0.2.0 + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudioCode + directives: + description: Install Visual Studio Code + allowPrerelease: true + settings: + id: Microsoft.VisualStudioCode + source: winget + - resource: PSDscResources/Script + id: VisualStudioCode Extensions + directives: + description: Script to install Visual Studio Code extensions + allowPrerelease: true + settings: + GetScript: | + # Not using this at the moment. + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\web-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\web-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - VisualStudioCode \ No newline at end of file diff --git a/configurations/3d-printing-configuration.dsc.yaml b/configurations/3d-printing-configuration.dsc.yaml index 63f7a05..cc097ca 100644 --- a/configurations/3d-printing-configuration.dsc.yaml +++ b/configurations/3d-printing-configuration.dsc.yaml @@ -1,61 +1,56 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with 3d printing # -# NOTE: Run: winget configure .\3d-printing-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\3d-printing-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\3d-printing-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\3d-printing-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: 3D-Printing Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/configurations/ai-configuration.dsc.yaml b/configurations/ai-configuration.dsc.yaml index 2a7bc19..fa2afb1 100644 --- a/configurations/ai-configuration.dsc.yaml +++ b/configurations/ai-configuration.dsc.yaml @@ -1,77 +1,100 @@ -# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json ########################################################################################################## # This configuration will install the tools necessary to get started developing AI Applications # -# NOTE: Run: winget configure .\ai-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\ai-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Ollama - directives: - description: Install Ollama - allowPrerelease: true - settings: - id: "Ollama.Ollama" - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: LMStudio - directives: - description: Install LMStudio - allowPrerelease: true - settings: - id: "LMStudio.LMStudio" - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\ai-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: AI Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Ollama + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: Ollama.Ollama + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: LMStudio + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: LMStudio.LMStudio + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\ai-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + - name: VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + id: Microsoft.VisualStudioCode + source: winget + UseLatest: true + Ensure: Present + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + # Return the currently installed VS Code extensions as a comma‐separated string. + $installedExtensions = code --list-extensions + return @{ Result = $installedExtensions } + TestScript: | + # Ignore deprecation warnings & reset PATH + $env:NODE_OPTIONS = "--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + $jsonPath = Join-Path $env:WinGetConfigRoot "ai-configuration-vscode-extensions.json" + $jsonContent = Get-Content $jsonPath -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions. + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed. + $allInstalled = $extensions | ForEach-Object { $_.name -in $installedExtensions } + return ($allInstalled -contains $false) -eq $false + SetScript: | + # Ignore deprecation warnings & reset PATH + $env:NODE_OPTIONS = "--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + $jsonPath = Join-Path $env:WinGetConfigRoot "ai-configuration-vscode-extensions.json" + $jsonContent = Get-Content $jsonPath -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" \ No newline at end of file diff --git a/configurations/azure-configuration.dsc.yaml b/configurations/azure-configuration.dsc.yaml index df9561b..1d0779f 100644 --- a/configurations/azure-configuration.dsc.yaml +++ b/configurations/azure-configuration.dsc.yaml @@ -1,109 +1,104 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing in azure # -# NOTE: Run: winget configure .\azure-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\azure-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: AzureCLI - directives: - description: Install Azure CLI - allowPrerelease: true - settings: - id: Microsoft.AzureCLI - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: AzureCosmosDbEmulator - directives: - description: Install Azure Cosmos DB Emulator - allowPrerelease: true - settings: - id: Microsoft.Azure.CosmosEmulator - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: AzureDeveloperCLI - directives: - description: Install Azure Developer CLI - allowPrerelease: true - settings: - id: microsoft.azd - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: AzureFunctionsCoreTools - directives: - description: Install Azure Functions CoreTools - allowPrerelease: true - settings: - id: Microsoft.Azure.FunctionsCoreTools - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: AzureStorageExplorer - directives: - description: Install Azure Storage Explorer - allowPrerelease: true - settings: - id: Microsoft.Azure.StorageExplorer - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: BicepCLI - directives: - description: Install Bicep CLI - allowPrerelease: true - settings: - id: Microsoft.Bicep - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\azure-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Azure Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Microsoft.AzureCLI + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + - name: Microsoft.Azure.CosmosEmulator + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: microsoft.azd + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Microsoft.Azure.FunctionsCoreTools + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: Microsoft.Azure.StorageExplorer + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: Microsoft.Bicep + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\azure-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/c-cplusplus-configuration.dsc.yaml b/configurations/c-cplusplus-configuration.dsc.yaml index c042c22..eb32f86 100644 --- a/configurations/c-cplusplus-configuration.dsc.yaml +++ b/configurations/c-cplusplus-configuration.dsc.yaml @@ -1,61 +1,56 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing in C/C++ # -# NOTE: Run: winget configure .\c-cplusplus-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\c-cplusplus-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\c-cplusplus-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\c-cplusplus-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: C-Cplusplus Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/configurations/configuration.dsc.yaml b/configurations/configuration.dsc.yaml index e27eedb..2a5cb8c 100644 --- a/configurations/configuration.dsc.yaml +++ b/configurations/configuration.dsc.yaml @@ -1,191 +1,184 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing in dotnet on Windows 11 # -# NOTE: Run: winget configure .\configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: 7Zip - directives: - description: Install 7Zip - allowPrerelease: true - settings: - id: "7zip.7zip" - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: FiddlerClassic - directives: - description: Install Telerik Fiddler Classic - allowPrerelease: true - settings: - id: Telerik.Fiddler.Classic - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Fork - directives: - description: Install fork - allowPrerelease: true - settings: - id: Fork.Fork - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Git - directives: - description: Install Git - allowPrerelease: true - settings: - id: Git.Git - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: GitHubClI - directives: - description: Install GitHub Cli - allowPrerelease: true - settings: - id: GitHub.cli - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: GoogleChrome - directives: - description: Install Google Chrome - allowPrerelease: true - settings: - id: Google.Chrome - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Jq - directives: - description: Install jq - allowPrerelease: true - settings: - id: jqlang.jq - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: NodeJs - directives: - description: Install NodeJS - allowPrerelease: true - settings: - id: OpenJS.NodeJS.LTS - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: NotepadPlusPlus - directives: - description: Install Notepad++ - allowPrerelease: true - settings: - id: Notepad++.Notepad++ - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: NugetPackageExplorer - directives: - description: Nuget Package Explorer - allowPrerelease: true - settings: - id: "9WZDNCRDMDM3" - source: msstore - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: PowerShell7 - directives: - description: Install PowerShell 7 - allowPrerelease: true - settings: - id: Microsoft.PowerShell - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Slack - directives: - description: Install Slack - allowPrerelease: true - settings: - id: SlackTechnologies.Slack - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: TortoiseGit - directives: - description: Install TortoiseGit - allowPrerelease: true - settings: - id: TortoiseGit.TortoiseGit - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Ubuntu2204 - directives: - description: Ubuntu 22.04 LTS - allowPrerelease: true - settings: - id: Canonical.Ubuntu.2204 - source: winget - dependsOn: - - Wsl - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: WinMerge - directives: - description: Install WinMerge - allowPrerelease: true - settings: - id: WinMerge.WinMerge - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Wsl - directives: - description: Install Windows Subsystem for Linux - allowPrerelease: true - settings: - id: "9P9TQF7MRM4R" - source: msstore \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Configuration Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: "7zip.7zip" + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + - name: Telerik.Fiddler.Classic + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Fork.Fork + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Git.Git + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: GitHub.cli + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Google.Chrome + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: jqlang.jq + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: OpenJS.NodeJS.LTS + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Notepad++.Notepad++ + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: "9WZDNCRDMDM3" + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: msstore + UseLatest: true + Ensure: Present + + - name: Microsoft.PowerShell + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: SlackTechnologies.Slack + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: TortoiseGit.TortoiseGit + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Canonical.Ubuntu.2204 + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + dependsOn: + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','Wsl')]" + + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + - name: WinMerge.WinMerge + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + - name: "9P9TQF7MRM4R" + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: msstore + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/configurations/container-configuration.dsc.yaml b/configurations/container-configuration.dsc.yaml index 11c88e3..8a4ef06 100644 --- a/configurations/container-configuration.dsc.yaml +++ b/configurations/container-configuration.dsc.yaml @@ -1,69 +1,64 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with containers # -# NOTE: Run: winget configure .\container-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\container-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Docker - directives: - description: Install Docker - allowPrerelease: true - settings: - id: Docker.DockerDesktop - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\container-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: Container Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Docker.DockerDesktop + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\container-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/data-configuration.dsc.yaml b/configurations/data-configuration.dsc.yaml index 59d9b60..fc6b374 100644 --- a/configurations/data-configuration.dsc.yaml +++ b/configurations/data-configuration.dsc.yaml @@ -1,77 +1,72 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with data # -# NOTE: Run: winget configure .\data-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\data-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: SQLServerManagementStudio - directives: - description: Install SSMS - SQL Server Management Studio - allowPrerelease: true - settings: - id: Microsoft.SQLServerManagementStudio - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: AzureDataStudio - directives: - description: Install Azure DataStudio - allowPrerelease: true - settings: - id: Microsoft.AzureDataStudio - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\data-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: Data Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Microsoft.SQLServerManagementStudio + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: Microsoft.AzureDataStudio + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\data-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/documentation-configuration.dsc.yaml b/configurations/documentation-configuration.dsc.yaml index 225ca9f..473fa6e 100644 --- a/configurations/documentation-configuration.dsc.yaml +++ b/configurations/documentation-configuration.dsc.yaml @@ -1,69 +1,64 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with documentation # -# NOTE: Run: winget configure .\documentation-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\documentation-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: DiagramsNet - directives: - description: Install Diagrams.Net - allowPrerelease: true - settings: - id: JGraph.Draw - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\documentation-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: Documentation Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: JGraph.Draw + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\documentation-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/dotnet-configuration.dsc.yaml b/configurations/dotnet-configuration.dsc.yaml index 7a2491e..7f64a9e 100644 --- a/configurations/dotnet-configuration.dsc.yaml +++ b/configurations/dotnet-configuration.dsc.yaml @@ -1,135 +1,165 @@ -# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json ########################################################################################################## # This configuration will install the tools necessary to get started developing in dotnet # -# NOTE: Run: winget configure .\dotnet-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\dotnet-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: DotNetSDK8 - directives: - description: Install Microsoft .NET SDK 8.0 - allowPrerelease: true - settings: - id: Microsoft.DotNet.SDK.8 - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudio - directives: - description: Install Visual Studio 2022 Enterprise - allowPrerelease: true - settings: - id: Microsoft.VisualStudio.2022.Enterprise - source: winget - - resource: Microsoft.VisualStudio.DSC/VSComponents - directives: - description: Install required VS workloads from project .vsconfig file - allowPrerelease: true - settings: - productId: Microsoft.VisualStudio.Product.Enterprise - channelId: VisualStudio.17.Release - vsConfigFile: '${WinGetConfigRoot}\.vsconfig' - dependsOn: - - VisualStudio - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode - - resource: PSDscResources/Script - id: DotNetTools - directives: - description: Script to manage .NET tools installation - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Load required tools from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-tools-configuration.json' -Raw - $requiredTools = (ConvertFrom-Json $jsonContent).tools.id - - # Get the list of currently installed global tools - $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } - - # Check if all required tools are installed - $allInstalled = $true - foreach ($toolId in $requiredTools) { - if (-not ($installedTools -contains $toolId)) { - $allInstalled = $false - break - } - } - - return $allInstalled - SetScript: | - # Load required tools from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-tools-configuration.json' -Raw - $tools = (ConvertFrom-Json $jsonContent).tools - - # Get the list of currently installed global tools by parsing the first column - $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } - - foreach ($tool in $tools) { - $toolId = $tool.id - $toolVersion = $tool.version - - # Install the tool if it is not already installed - if (-not ($installedTools -contains $toolId)) { - $installCommand = "dotnet tool install -g $toolId" - if ($toolVersion -ne "latest") { - $installCommand += " --version $toolVersion" + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: .NET Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: DotNetSDK8 + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: Microsoft.DotNet.SDK.8 + source: winget + UseLatest: true + Ensure: Present + + - name: VisualStudio + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: Microsoft.VisualStudio.2022.Enterprise + source: winget + UseLatest: true + Ensure: Present + + - name: VSComponents + type: Microsoft.VisualStudio.DSC/VSComponents + properties: + productId: Microsoft.VisualStudio.Product.Enterprise + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\.vsconfig' + dependsOn: + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudio')]" + + - name: VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: Microsoft.VisualStudioCode + source: winget + UseLatest: true + Ensure: Present + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + # Return the currently installed VS Code extensions as a comma‐separated string. + $installedExtensions = code --list-extensions + return @{ Result = $installedExtensions } + TestScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed + $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + + return $allInstalled -contains $false -eq $false + SetScript: | + # Ignore deprecation warnings & reload path + $env:NODE_OPTIONS="--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + # Load required extensions from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-configuration-vscode-extensions.json' -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + + - name: DotNetTools + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to manage .NET tools installation + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + # Return currently installed .NET tools + $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } + return @{ Result = $installedTools -join ',' } + TestScript: | + # Load required tools from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-tools-configuration.json' -Raw + $requiredTools = (ConvertFrom-Json $jsonContent).tools.id + + # Get the list of currently installed global tools + $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } + + # Check if all required tools are installed + $allInstalled = $true + foreach ($toolId in $requiredTools) { + if (-not ($installedTools -contains $toolId)) { + $allInstalled = $false + break + } } - Invoke-Expression $installCommand - } - } \ No newline at end of file + return $allInstalled + SetScript: | + # Load required tools from JSON file + $jsonContent = Get-Content '${WinGetConfigRoot}\dotnet-tools-configuration.json' -Raw + $tools = (ConvertFrom-Json $jsonContent).tools + + # Get the list of currently installed global tools by parsing the first column + $installedTools = dotnet tool list -g | Select-Object -Skip 2 | ForEach-Object { ($_ -split '\s+')[0] } + + foreach ($tool in $tools) { + $toolId = $tool.id + $toolVersion = $tool.version + + # Install the tool if it is not already installed + if (-not ($installedTools -contains $toolId)) { + $installCommand = "dotnet tool install -g $toolId" + if ($toolVersion -ne "latest") { + $installCommand += " --version $toolVersion" + } + + Invoke-Expression $installCommand + } + } + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','DotNetSDK8')]" \ No newline at end of file diff --git a/configurations/embedded-devices-configuration.dsc.yaml b/configurations/embedded-devices-configuration.dsc.yaml index 40618f8..a25b750 100644 --- a/configurations/embedded-devices-configuration.dsc.yaml +++ b/configurations/embedded-devices-configuration.dsc.yaml @@ -1,61 +1,56 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with embedded devices # -# NOTE: Run: winget configure .\embedded-devices-configuration.dsc.yaml --accept-configuration-agreements# +# NOTE: Run: dsc config .\embedded-devices-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\embedded-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\embedded-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Embedded-Devices Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/configurations/game-configuration.dsc.yaml b/configurations/game-configuration.dsc.yaml index 108df27..fd9dc38 100644 --- a/configurations/game-configuration.dsc.yaml +++ b/configurations/game-configuration.dsc.yaml @@ -1,61 +1,86 @@ -# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json ########################################################################################################## # This configuration will install the tools necessary to get started developing games # -# NOTE: Run: winget configure .\game-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\game-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\game-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\game-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Game Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: Microsoft.VisualStudioCode + source: winget + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + # Return the currently installed VS Code extensions as a comma‐separated string. + $installedExtensions = code --list-extensions + return @{ Result = $installedExtensions } + TestScript: | + # Ignore deprecation warnings & reset PATH + $env:NODE_OPTIONS = "--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + $jsonPath = Join-Path $env:WinGetConfigRoot "game-configuration-vscode-extensions.json" + $jsonContent = Get-Content $jsonPath -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions. + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed. + $allInstalled = $extensions | ForEach-Object { $_.name -in $installedExtensions } + return ($allInstalled -contains $false) -eq $false + SetScript: | + # Ignore deprecation warnings & reset PATH + $env:NODE_OPTIONS = "--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + $jsonPath = Join-Path $env:WinGetConfigRoot "game-configuration-vscode-extensions.json" + $jsonContent = Get-Content $jsonPath -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/configurations/java-configuration.dsc.yaml b/configurations/java-configuration.dsc.yaml index f47edef..795382a 100644 --- a/configurations/java-configuration.dsc.yaml +++ b/configurations/java-configuration.dsc.yaml @@ -1,61 +1,56 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing in java # -# NOTE: Run: winget configure .\java-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\java-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\java-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\java-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Java Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/configurations/os-configuration.dsc.yaml b/configurations/os-configuration.dsc.yaml index 9ebb2f1..0d5ddda 100644 --- a/configurations/os-configuration.dsc.yaml +++ b/configurations/os-configuration.dsc.yaml @@ -1,65 +1,68 @@ -# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json ########################################################################################################## # This configuration will configure various windows settings on Windows 11 # -# NOTE: Run: winget configure .\os-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\os-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - assertions: - - resource: Microsoft.Windows.Developer/OsVersion - id: osVersionAssertion - directives: - description: Verify min OS version requirement - allowPrerelease: true - settings: - MinVersion: '10.0.22631' - resources: - - resource: Microsoft.Windows.Developer/DeveloperMode - id: developerMode - directives: - description: Enable Developer Mode - allowPrerelease: true - settings: - Ensure: Present - dependsOn: - - osVersionAssertion - - resource: Microsoft.Windows.Developer/ShowHiddenFiles - id: showHiddenFiles - directives: - description: Show hidden files - allowPrerelease: true - settings: - Ensure: Present # Ensuring Hidden files are shown - dependsOn: - - osVersionAssertion - - resource: Microsoft.Windows.Developer/HideFileExtensions - id: hideFileExtensions - directives: - description: Show file extensions - allowPrerelease: true - settings: - Ensure: Absent # Ensuring FileExtensions are shown (disables that they should be hidden) - dependsOn: - - osVersionAssertion - - resource: Microsoft.Windows.Developer/EnableDarkMode - id: enableDarkMode - directives: - description: Enable dark mode - allowPrerelease: true - settings: - Ensure: Present - # Use caution when setting `RestartExplorer: true` as this will force explorer to close. - RestartExplorer: true # Required to apply changes - dependsOn: - - osVersionAssertion - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Flux - directives: - description: Install f.lux - allowPrerelease: true - settings: - id: flux.flux - source: winget - dependsOn: - - osVersionAssertion \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: osVersionAssertion + type: Microsoft.Windows.Developer/OsVersion + properties: + MinVersion: '10.0.22631' + + - name: Windows Developer Settings + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: developerMode + type: Microsoft.Windows.Developer/DeveloperMode + properties: + Ensure: Present + dependsOn: + - "[resourceId('Microsoft.Windows.Developer/OsVersion','osVersionAssertion')]" + + - name: showHiddenFiles + type: Microsoft.Windows.Developer/ShowHiddenFiles + properties: + Ensure: Present # Ensuring Hidden files are shown + dependsOn: + - "[resourceId('Microsoft.Windows.Developer/OsVersion','osVersionAssertion')]" + + - name: hideFileExtensions + type: Microsoft.Windows.Developer/HideFileExtensions + properties: + Ensure: Absent # Ensuring FileExtensions are shown (disables that they should be hidden) + dependsOn: + - "[resourceId('Microsoft.Windows.Developer/OsVersion','osVersionAssertion')]" + + - name: enableDarkMode + type: Microsoft.Windows.Developer/EnableDarkMode + properties: + Ensure: Present + # Use caution when setting `RestartExplorer: true` as this will force explorer to close. + RestartExplorer: true # Required to apply changes + dependsOn: + - "[resourceId('Microsoft.Windows.Developer/OsVersion','osVersionAssertion')]" + + - name: Flux + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + id: flux.flux + source: winget + UseLatest: true + Ensure: Present + dependsOn: + - "[resourceId('Microsoft.Windows.Developer/OsVersion','osVersionAssertion')]" + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" \ No newline at end of file diff --git a/configurations/python-configuration.dsc.yaml b/configurations/python-configuration.dsc.yaml index 6a4fc4c..5e25b65 100644 --- a/configurations/python-configuration.dsc.yaml +++ b/configurations/python-configuration.dsc.yaml @@ -1,77 +1,72 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with python # -# NOTE: Run: winget configure .\python-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\python-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Python - directives: - description: Install Python - allowPrerelease: true - settings: - id: Python.Python.3.12 - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: PyCharm - directives: - description: Install JetBrains PyCharm Community Edition - allowPrerelease: true - settings: - id: JetBrains.PyCharm.Community - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\python-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: Python Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: Python.Python.3.12 + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: JetBrains.PyCharm.Community + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\python-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/remoting-configuration.dsc.yaml b/configurations/remoting-configuration.dsc.yaml index 6a8bff5..52491b1 100644 --- a/configurations/remoting-configuration.dsc.yaml +++ b/configurations/remoting-configuration.dsc.yaml @@ -1,77 +1,72 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with remoting # -# NOTE: Run: winget configure .\remoting-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\remoting-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: WinSCP - directives: - description: Install WinSCP - allowPrerelease: true - settings: - id: WinSCP.WinSCP - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: PuTTY - directives: - description: Install PuTTY - allowPrerelease: true - settings: - id: PuTTY.PuTTY - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\remoting-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: Remoting Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: WinSCP.WinSCP + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: PuTTY.PuTTY + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\remoting-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/rest-api-configuration.dsc.yaml b/configurations/rest-api-configuration.dsc.yaml index b07f1ca..3f6de87 100644 --- a/configurations/rest-api-configuration.dsc.yaml +++ b/configurations/rest-api-configuration.dsc.yaml @@ -1,101 +1,96 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + # yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 ########################################################################################################## # This configuration will install the tools necessary to get started developing with rest-api's # -# NOTE: Run: winget configure .\rest-api-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\rest-api-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: k6 - directives: - description: Install k6 load testing - allowPrerelease: true - settings: - id: k6.k6 - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Bruno - directives: - description: Install Bruno - allowPrerelease: true - settings: - id: Bruno.Bruno - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Postman - directives: - description: Install Postman - allowPrerelease: true - settings: - id: Postman.Postman - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: Insomnia - directives: - description: Install Insomnia - allowPrerelease: true - settings: - id: Insomnia.Insomnia - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: StoplightStudio - directives: - description: Install Stoplight Studio - allowPrerelease: true - settings: - id: Stoplight.Studio - source: winget - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\rest-api-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Rest-Api Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: k6.k6 + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + source: winget + UseLatest: true + Ensure: Present + + - name: Bruno.Bruno + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present + + - name: Postman.Postman + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: Insomnia.Insomnia + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } + - name: Stoplight.Studio + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + - name: Microsoft.VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + allowPrerelease: true + source: winget + UseLatest: true + Ensure: Present - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\rest-api-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + return @{ Result = 'Not implemented' } + TestScript: | + return $false + SetScript: | + # Implementation needed + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file diff --git a/configurations/web-configuration.dsc.yaml b/configurations/web-configuration.dsc.yaml index 953a10b..91ea50e 100644 --- a/configurations/web-configuration.dsc.yaml +++ b/configurations/web-configuration.dsc.yaml @@ -1,61 +1,86 @@ -# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# yaml-language-server: $schema=https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/bundled/config/document.vscode.json +$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json ########################################################################################################## # This configuration will install the tools necessary to get started developing web frontends # -# NOTE: Run: winget configure .\web-configuration.dsc.yaml --accept-configuration-agreements # +# NOTE: Run: dsc config .\web-configuration.dsc.yaml # ########################################################################################################## -properties: - configurationVersion: 0.2.0 - resources: - - resource: Microsoft.WinGet.DSC/WinGetPackage - id: VisualStudioCode - directives: - description: Install Visual Studio Code - allowPrerelease: true - settings: - id: Microsoft.VisualStudioCode - source: winget - - resource: PSDscResources/Script - id: VisualStudioCode Extensions - directives: - description: Script to install Visual Studio Code extensions - allowPrerelease: true - settings: - GetScript: | - # Not using this at the moment. - TestScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\web-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Check if all required extensions are installed - $allInstalled = $extensions.name | ForEach-Object { $_ -in $installedExtensions } - - return $allInstalled -contains $false -eq $false - SetScript: | - # Ignore deprecation warnings & reload path - $env:NODE_OPTIONS="--no-deprecation" - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") - - # Load required extensions from JSON file - $jsonContent = Get-Content '${WinGetConfigRoot}\web-configuration-vscode-extensions.json' -Raw - $extensions = (ConvertFrom-Json $jsonContent).extensions - - # Get the list of currently installed extensions - $installedExtensions = code --list-extensions - - # Install each extension if not already installed - foreach ($extension in $extensions) { - if ($installedExtensions -notcontains $extension.name) { - code --install-extension $extension.name - } - } - dependsOn: - - VisualStudioCode \ No newline at end of file + +metadata: + Microsoft.DSC: + securityContext: elevated + +resources: + - name: assert-windows + type: Microsoft.DSC/Assertion + properties: + $schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json + resources: + - name: os + type: Microsoft/OSInfo + properties: + family: Windows + + - name: Web Development Tools + type: Microsoft.DSC/PowerShell + properties: + resources: + - name: VisualStudioCode + type: Microsoft.WinGet.DSC/WinGetPackage + properties: + Id: Microsoft.VisualStudioCode + source: winget + UseLatest: true + Ensure: Present + + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + + - name: VisualStudioCode Extensions + type: Microsoft.Windows/WindowsPowerShell + properties: + resources: + - name: Script to install Visual Studio Code extensions + type: PSDesiredStateConfiguration/Script + properties: + GetScript: | + # Return the currently installed VS Code extensions as a comma‐separated string. + $installedExtensions = code --list-extensions + return @{ Result = $installedExtensions } + TestScript: | + # Ignore deprecation warnings & reset PATH + $env:NODE_OPTIONS = "--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + $jsonPath = Join-Path $env:WinGetConfigRoot "web-configuration-vscode-extensions.json" + $jsonContent = Get-Content $jsonPath -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions. + $installedExtensions = code --list-extensions + + # Check if all required extensions are installed. + $allInstalled = $extensions | ForEach-Object { $_.name -in $installedExtensions } + return ($allInstalled -contains $false) -eq $false + SetScript: | + # Ignore deprecation warnings & reset PATH + $env:NODE_OPTIONS = "--no-deprecation" + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + + $jsonPath = Join-Path $env:WinGetConfigRoot "web-configuration-vscode-extensions.json" + $jsonContent = Get-Content $jsonPath -Raw + $extensions = (ConvertFrom-Json $jsonContent).extensions + + # Get the list of currently installed extensions + $installedExtensions = code --list-extensions + + # Install each extension if not already installed + foreach ($extension in $extensions) { + if ($installedExtensions -notcontains $extension.name) { + code --install-extension $extension.name + } + } + dependsOn: + - "[resourceId('Microsoft.DSC/Assertion','assert-windows')]" + - "[resourceId('Microsoft.WinGet.DSC/WinGetPackage','VisualStudioCode')]" + diff --git a/setup.ps1 b/setup.ps1 index 9712f36..2a93bac 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -18,6 +18,31 @@ function IsPowershellRunningWithAdminRights return $true; } +function IsDSCv3Available { + # Check if DSC v3 CLI is available + try { + $dscVersion = dsc --version 2>$null + if ($dscVersion) { + Write-Host "DSC v3 CLI found: $dscVersion" -ForegroundColor Green + return $true + } + } catch { + # DSC v3 not available + } + + Write-Warning "DSC v3 CLI not found. Using WinGet for DSC v2 configurations." + return $false +} + +function IsConfigurationDSCv3 { + param ( + [string]$configPath + ) + + $content = Get-Content $configPath -Raw + return $content -match '\$schema.*dsc/schemas/v3' +} + function IsWingetVersionCorrect { param ( [string]$requiredVersion = "1.7.10661" @@ -49,14 +74,37 @@ function Invoke-ProfileProcess { Clear-Host $operationVerb = if ($mode -eq "Apply") { "Applying" } else { "Testing" } - $wingetCommand = if ($mode -eq "Apply") { "configure" } else { "configure test" } - + Write-Host "$operationVerb profile: " -NoNewline -ForegroundColor Yellow Write-Host $($profilePath) - $output = Invoke-Expression "winget $wingetCommand -f `"$profilePath`" --accept-configuration-agreements" 2>&1 - - Write-ConfigurationOutput -consoleOutput $output -mode $mode + # Determine if this is a DSC v3 configuration + $isDSCv3 = IsConfigurationDSCv3 -configPath $profilePath + $isDSCv3Available = IsDSCv3Available + + if ($isDSCv3 -and $isDSCv3Available) { + # Use DSC v3 CLI + Write-Host "Using DSC v3 CLI..." -ForegroundColor Cyan + + if ($mode -eq "Apply") { + $output = dsc config set -f $profilePath 2>&1 + } else { + $output = dsc config test -f $profilePath 2>&1 + } + + Write-DSCv3Output -consoleOutput $output -mode $mode + } elseif ($isDSCv3 -and -not $isDSCv3Available) { + Write-Warning "This is a DSC v3 configuration but DSC v3 CLI is not available." + Write-Warning "Please install DSC v3 CLI or use a DSC v2 configuration." + return + } else { + # Use WinGet for DSC v2 configurations + Write-Host "Using WinGet CLI for DSC v2 configuration..." -ForegroundColor Cyan + $wingetCommand = if ($mode -eq "Apply") { "configure" } else { "configure test" } + $output = Invoke-Expression "winget $wingetCommand -f `"$profilePath`" --accept-configuration-agreements" 2>&1 + Write-ConfigurationOutput -consoleOutput $output -mode $mode + } + Read-Host "Press Enter to continue..." } @@ -202,12 +250,79 @@ function Write-ConfigurationOutput { Write-Host "----------------------------------------------------------------------" } +function Write-DSCv3Output { + param ( + [Parameter(Mandatory = $true)] + [object] + $consoleOutput, + + [Parameter(Mandatory = $true)] + [ValidateSet("Test", "Apply")] + [string] + $mode + ) + + $consoleOutputString = if ($consoleOutput -is [String]) { $consoleOutput } else { $consoleOutput | Out-String } + + Write-Host "----------------------------------------------------------------------" + Write-Host "DSC v3 Configuration Output:" -ForegroundColor Yellow + Write-Host "----------------------------------------------------------------------" + + # For DSC v3, output is typically JSON formatted + try { + # Try to parse as JSON for structured output + $jsonOutput = $consoleOutputString | ConvertFrom-Json -ErrorAction Stop + + # Display structured results + if ($jsonOutput.results) { + foreach ($result in $jsonOutput.results) { + $resourceName = $result.name ?? "Unknown" + $resourceType = $result.type ?? "Unknown" + + if ($result.result) { + $beforeState = $result.result.beforeState ?? @{} + $afterState = $result.result.afterState ?? @{} + $changed = $result.result.changedProperties ?? @() + + $status = if ($changed.Count -gt 0) { "Changed" } else { "No Change Required" } + $color = if ($changed.Count -gt 0) { "Yellow" } else { "Green" } + + Write-Host "$resourceType" -NoNewline -ForegroundColor Yellow + Write-Host " [$resourceName]" -NoNewline -ForegroundColor Blue + Write-Host " $status" -ForegroundColor $color + + if ($changed.Count -gt 0) { + foreach ($change in $changed) { + Write-Host " └─ Changed: $change" -ForegroundColor Gray + } + } + } else { + Write-Host "$resourceType" -NoNewline -ForegroundColor Yellow + Write-Host " [$resourceName]" -NoNewline -ForegroundColor Blue + Write-Host " Processed" -ForegroundColor Green + } + } + } else { + # Fallback for non-structured output + Write-Host $consoleOutputString -ForegroundColor White + } + } catch { + # If not JSON, display as plain text + Write-Host $consoleOutputString -ForegroundColor White + } + + Write-Host "----------------------------------------------------------------------" +} + $isPowershellRunningWithAdminRights = IsPowershellRunningWithAdminRights if(!$isPowershellRunningWithAdminRights) { break } +# Check DSC v3 availability (informational) +$isDSCv3Available = IsDSCv3Available + $isWingetVersionCorrect = IsWingetVersionCorrect if(!$isWingetVersionCorrect) {