diff --git a/README.md b/README.md index fcc0e63..52a8162 100644 --- a/README.md +++ b/README.md @@ -1 +1,19 @@ -# cloud-admin \ No newline at end of file +# cloud-admin + +A collection of PowerShell scripts, Azure/DevOps tooling, and SQL utilities for managing cloud infrastructure, developer environments, and Active Directory. + +## ⭐ Showcase: New-DevMachine.ps1 +[scripts/dev-experience/New-DevMachine.ps1](scripts/dev-experience/New-DevMachine.ps1) bootstraps a new Windows 11 developer machine end-to-end via `winget`: PowerShell, Windows Terminal, PowerToys, Git/GitHub CLI, Azure CLI/Bicep, .NET SDK, Visual Studio, VS Code (with a curated critical extension set), SQL Server Developer Edition, Azure Functions Core Tools, Ollama (+ Phi-4 model pull), Microsoft Scout Agent, and Microsoft 365 Copilot. Node.js, Python, and Power Platform tooling are available as opt-in extras. + +```powershell +./scripts/dev-experience/New-DevMachine.ps1 -GitUserName "Your Name" -GitUserEmail "you@example.com" +``` + +See [docs/How-to Setup - Dev Machine.md](docs/How-to%20Setup%20-%20Dev%20Machine.md) for the full manual walkthrough this script automates. + +## Repository Structure +| Folder | Description | +|---|---| +| [docs/](docs) | How-to guides and command references | +| [scripts/](scripts) | PowerShell scripts for Azure, DevOps, dev machine setup, and Windows servers | +| [t-sql/](t-sql) | SQL Server DBA scripts | \ No newline at end of file diff --git a/docs/How-to Setup - Dev Machine.md b/docs/How-to Setup - Dev Machine.md index 4e53ee6..cbf16dc 100644 --- a/docs/How-to Setup - Dev Machine.md +++ b/docs/How-to Setup - Dev Machine.md @@ -41,7 +41,6 @@ git config --global user.name "Your Name" winget install --id GitHub.cli --silent ``` - ## IDEs and Editors ### Visual Studio [Visual Studio Workload IDs](https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2026&preserve-view=true) @@ -63,7 +62,7 @@ Common workloads: ### VS Code (code .) Install VS Code ``` -winget install Microsoft.VisualStudioCode --override '/SILENT /mergetasks="!runcode,addcontextmenufiles,addcontextmenufolders"' +winget install --id Microsoft.VisualStudioCode --exact --silent --accept-package-agreements --accept-source-agreements ``` Add C# DevKit to VS Code ``` @@ -73,17 +72,13 @@ IntelliCode for C# ``` code --install-extension ms-dotnettools.vscodeintellicode-csharp ``` -Add Kusto KQL and Log Analytics Workspace -``` -code --install-extension donjayamanne.kusto -``` ### General VS Code Extensions Hex Editor ``` code --install-extension ms-vscode.hexeditor ``` -PowerShell Extension +PowerShell Extension (critical) ``` code --install-extension ms-vscode.powershell ``` @@ -95,17 +90,13 @@ Remote WSL Extension ``` code --install-extension ms-vscode-remote.remote-wsl ``` -XML Extension -``` -code --install-extension redhat.vscode-xml -``` -YAML Extension +YAML Extension (critical, non-Microsoft exception) ``` code --install-extension redhat.vscode-yaml ``` -Compare Folders Extension +Bicep Extension (critical) ``` -code --install-extension moshfeu.compare-folders +code --install-extension ms-azuretools.vscode-bicep ``` ### Paint.NET @@ -202,9 +193,13 @@ code --install-extension GitHub.copilot-chat ``` code --install-extension ms-windows-ai-studio.windows-ai-studio ``` -### Teams AI Foundry Extension +### Microsoft Scout Agent +``` +winget install --id Microsoft.ScoutAgent --exact --silent --accept-package-agreements --accept-source-agreements +``` +### Microsoft 365 Copilot ``` -code --install-extension TeamsDevApp.vscode-ai-foundry +winget install --id Microsoft.365Copilot --exact --silent --accept-package-agreements --accept-source-agreements ``` ## Database Development @@ -220,18 +215,18 @@ code --install-extension ms-mssql.mssql code --install-extension ms-mssql.sql-database-projects-vscode ``` -### Database Queries/ERD +### Database Queries/ERD (non-Microsoft exception) ``` code --install-extension DBCode.dbcode ``` -## Javascript Development +## Javascript Development (optional) ### Node.js (node and npm) ``` winget install -e --id OpenJS.NodeJS --silent ``` -## Python Development +## Python Development (optional) ### Python (pip) ``` winget install python.python.3.12 --silent diff --git a/scripts/dev-experience/New-DevMachine.ps1 b/scripts/dev-experience/New-DevMachine.ps1 index cb76e30..70f5f7d 100644 --- a/scripts/dev-experience/New-DevMachine.ps1 +++ b/scripts/dev-experience/New-DevMachine.ps1 @@ -2,9 +2,11 @@ .SYNOPSIS Sets up a new developer machine with mainstream tools and optional extras. .DESCRIPTION - Installs .NET SDK, PowerShell, Visual Studio 2022, VS Code, SQL Server Developer Edition by default. - Also installs Ollama by default for local AI model/runtime support and pulls Phi-4. - Optionally installs JavaScript/Node.js, Python, Power Platform tools, and non-mainstream .NET SDKs. + Installs .NET SDK, PowerShell, Visual Studio, VS Code, SQL Server Developer Edition by default. + Also installs Ollama, Microsoft Scout Agent, and Microsoft 365 Copilot by default for local AI + model/runtime support and pulls Phi-4. + JavaScript/Node.js and Python are strongly optional and are only installed when explicitly requested. + Optionally installs Power Platform tools and non-mainstream .NET SDKs. .PARAMETER InstallNode Installs Node.js and JavaScript tooling if set to $true. .PARAMETER InstallPython @@ -13,15 +15,21 @@ Installs Power Platform CLI/tools if set to $true. .PARAMETER InstallDotNetExtras Installs non-mainstream .NET SDKs if set to $true. +.PARAMETER GitUserName + Sets git config --global user.name to this value if provided. +.PARAMETER GitUserEmail + Sets git config --global user.email to this value if provided. .EXAMPLE - .\New-DevMachine.ps1 -InstallNode $true -InstallPython $false + .\New-DevMachine.ps1 -InstallNode $true -InstallPython $false -GitUserName "Your Name" -GitUserEmail "you@example.com" #> param( [bool]$InstallNode = $false, [bool]$InstallPython = $false, [bool]$InstallPowerPlatform = $false, - [bool]$InstallDotNetExtras = $false + [bool]$InstallDotNetExtras = $false, + [string]$GitUserName = "", + [string]$GitUserEmail = "" ) #################################################################################### @@ -71,6 +79,17 @@ if (-not (Get-Command git -ErrorAction SilentlyContinue)) { } else { Write-Host "Git already installed." -ForegroundColor DarkGray } +if ($GitUserName) { + git config --global user.name $GitUserName +} +if ($GitUserEmail) { + git config --global user.email $GitUserEmail +} +if (-not (Get-Command gh -ErrorAction SilentlyContinue)) { + winget install --id GitHub.cli --silent +} else { + Write-Host "GitHub CLI already installed." -ForegroundColor DarkGray +} if (-not (Get-Command "PaintDotNet" -ErrorAction SilentlyContinue)) { winget install Paint.NET --silent } else { @@ -128,80 +147,49 @@ if (-not (Get-Command dotnet -ErrorAction SilentlyContinue)) { Write-Host "dotnet-ef tool already installed." -ForegroundColor DarkGray } } +dotnet dev-certs https --trust if (-not (Get-Command devenv -ErrorAction SilentlyContinue)) { winget install --id Microsoft.VisualStudio.Community --override "--quiet --add Microsoft.Visualstudio.Workload.Azure --add Microsoft.VisualStudio.Workload.Data --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb" } else { Write-Host "Visual Studio already installed." -ForegroundColor DarkGray } if (-not (Get-Command code -ErrorAction SilentlyContinue)) { - winget install Microsoft.VisualStudioCode --override '/SILENT /mergetasks="!runcode,addcontextmenufiles,addcontextmenufolders"' + winget install --id Microsoft.VisualStudioCode --exact --silent --accept-package-agreements --accept-source-agreements $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine) + ";" + [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) if (-not (Get-Command code -ErrorAction SilentlyContinue)) { Write-Host "VS Code still not found after install. Please restart your shell and re-run this script to complete VS Code setup and extension installation." -ForegroundColor Red - } else { - $extensions = @( - "ms-dotnettools.csharp", - "ms-dotnettools.vscodeintellicode-csharp", - "ms-vscode.hexeditor", - "ms-vscode.powershell", - "ms-vscode.copilot-mermaid-diagram", - "ms-vscode-remote.remote-wsl", - "redhat.vscode-xml", - "redhat.vscode-yaml", - "moshfeu.compare-folders", - "ms-azuretools.vscode-azureresourcegroups", - "ms-azuretools.vscode-azure-github-copilot", - "GitHub.copilot", - "GitHub.copilot-chat", - "ms-windows-ai-studio.windows-ai-studio", - "TeamsDevApp.vscode-ai-foundry", - "ms-mssql.mssql", - "ms-mssql.sql-database-projects-vscode", - "DBCode.dbcode" - ) - foreach ($ext in $extensions) { - if (-not (code --list-extensions | Select-String -Pattern "^$ext$")) { - Write-Host "\n--- Installing VS Code extension: $ext ---\n" -ForegroundColor Green - code --install-extension $ext - } else { - Write-Host "VS Code extension $ext already installed." -ForegroundColor DarkGray - } - } } -} else { - Write-Host "VS Code already installed." -ForegroundColor DarkGray - if (Get-Command code -ErrorAction SilentlyContinue) { - $extensions = @( - "ms-dotnettools.csharp", - "ms-dotnettools.vscodeintellicode-csharp", - "ms-vscode.hexeditor", - "ms-vscode.powershell", - "ms-vscode.copilot-mermaid-diagram", - "ms-vscode-remote.remote-wsl", - "redhat.vscode-xml", - "redhat.vscode-yaml", - "moshfeu.compare-folders", - "ms-azuretools.vscode-azureresourcegroups", - "ms-azuretools.vscode-azure-github-copilot", - "GitHub.copilot", - "GitHub.copilot-chat", - "ms-windows-ai-studio.windows-ai-studio", - "TeamsDevApp.vscode-ai-foundry", - "ms-mssql.mssql", - "ms-mssql.sql-database-projects-vscode", - "DBCode.dbcode" - ) - foreach ($ext in $extensions) { - if (-not (code --list-extensions | Select-String -Pattern "^$ext$")) { - Write-Host "\n--- Installing VS Code extension: $ext ---\n" -ForegroundColor Green - code --install-extension $ext - } else { - Write-Host "VS Code extension $ext already installed." -ForegroundColor DarkGray - } +} +if (Get-Command code -ErrorAction SilentlyContinue) { + # Critical: C# (csharp), SQL Project, SSMS (mssql), Bicep, YAML (redhat), PowerShell. DBCode and redhat.vscode-yaml are the only non-Microsoft exceptions kept. + $extensions = @( + "ms-dotnettools.csharp", + "ms-dotnettools.vscodeintellicode-csharp", + "ms-vscode.hexeditor", + "ms-vscode.powershell", + "ms-vscode.copilot-mermaid-diagram", + "ms-vscode-remote.remote-wsl", + "redhat.vscode-yaml", + "ms-azuretools.vscode-bicep", + "ms-azuretools.vscode-azureresourcegroups", + "ms-azuretools.vscode-azure-github-copilot", + "GitHub.copilot", + "GitHub.copilot-chat", + "ms-windows-ai-studio.windows-ai-studio", + "ms-mssql.mssql", + "ms-mssql.sql-database-projects-vscode", + "DBCode.dbcode" + ) + foreach ($ext in $extensions) { + if (-not (code --list-extensions | Select-String -Pattern "^$ext$")) { + Write-Host "\n--- Installing VS Code extension: $ext ---\n" -ForegroundColor Green + code --install-extension $ext + } else { + Write-Host "VS Code extension $ext already installed." -ForegroundColor DarkGray } - } else { - Write-Host "VS Code command not found. Please restart your shell and re-run this script to install extensions." -ForegroundColor Red } +} else { + Write-Host "VS Code command not found. Please restart your shell and re-run this script to install extensions." -ForegroundColor Red } if (-not (Get-Command sqlservr -ErrorAction SilentlyContinue)) { Write-Host "\n--- Installing SQL Server Developer Edition ---\n" -ForegroundColor Yellow @@ -226,6 +214,10 @@ if (-not (Get-Command ollama -ErrorAction SilentlyContinue)) { } else { Write-Host "Ollama already installed." -ForegroundColor DarkGray } +Write-Host "\n--- Installing Microsoft Scout Agent ---\n" -ForegroundColor Yellow +winget install --id Microsoft.ScoutAgent --exact --silent --accept-package-agreements --accept-source-agreements +Write-Host "\n--- Installing Microsoft 365 Copilot ---\n" -ForegroundColor Yellow +winget install --id Microsoft.365Copilot --exact --silent --accept-package-agreements --accept-source-agreements $env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::Machine) + ";" + [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) if (-not (Get-Command ollama -ErrorAction SilentlyContinue)) { @@ -276,6 +268,13 @@ if ($InstallPowerPlatform) { } else { Write-Host "Power Platform CLI already installed." -ForegroundColor DarkGray } + if (Get-Command code -ErrorAction SilentlyContinue) { + if (-not (code --list-extensions | Select-String -Pattern "^microsoft-IsvExpTools.powerplatform-vscode$")) { + code --install-extension microsoft-IsvExpTools.powerplatform-vscode + } else { + Write-Host "Power Platform VS Code extension already installed." -ForegroundColor DarkGray + } + } } Write-Host "Developer machine setup complete." -ForegroundColor Cyan