diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..016a4f3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "FabricTools PowerShell Dev", + "features": { + "ghcr.io/devcontainers/features/powershell:1": {}, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/azure-cli:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + + "customizations": { + "vscode": { + "extensions": [ + "davidanson.vscode-markdownlint", + "ms-vscode.powershell", + "streetsidesoftware.code-spell-checker", + "redhat.vscode-yaml" + ] + } + }, + + "settings": { + "terminal.integrated.defaultProfile.linux": "pwsh" + }, + + "postCreateCommand": "pwsh .devcontainer/post-create.ps1" +} diff --git a/.devcontainer/post-create.ps1 b/.devcontainer/post-create.ps1 new file mode 100644 index 0000000..8e5744f --- /dev/null +++ b/.devcontainer/post-create.ps1 @@ -0,0 +1,36 @@ +# post-create.ps1 + +Write-Host "Running DevContainer post-create setup..." + +# Ensure scripts can run +Set-ExecutionPolicy RemoteSigned -Scope Process -Force + +# Install/update PSResourceGet side-by-side +Write-Host "Installing PSResourceGet..." +Install-Module Microsoft.PowerShell.PSResourceGet -Force -AllowClobber + +# Install common modules used in this environment +$requiredModules = @( + "Pester", + "Az.Accounts" +) + +Write-Host "Installing required modules..." +foreach ($module in $requiredModules) { + Install-Module $module -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber +} + +# Validate installation +foreach ($module in $requiredModules) { + if (-not (Get-Module -ListAvailable -Name $module)) { + Write-Warning "Module [$module] did NOT install successfully!" + } +} + +# Display installed versions for debugging +Write-Host "Installed module versions:" + +Get-Module -ListAvailable | + Where-Object { $_.Name -in $requiredModules + "Microsoft.PowerShell.PSResourceGet" } | + Sort-Object Name, Version | + Format-Table Name, Version, ModuleBase diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a6bb11..80e3bce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added GitHub Codespaces and DevContainerSupport (Non Functional Change) - Added function `Update-FabricCapacity` - Added Error Detailed Info in `Test-FabricApiResponse` (Debug mode) when `response.error` exists