Skip to content

Commit 0510ec6

Browse files
authored
Merge pull request #175 from jasonhorner/feature-jjh-add-devcontainer-support
Add Github Codespaces Support
2 parents 81b97b8 + 8979e7c commit 0510ec6

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "FabricTools PowerShell Dev",
3+
"features": {
4+
"ghcr.io/devcontainers/features/powershell:1": {},
5+
"ghcr.io/devcontainers/features/git:1": {},
6+
"ghcr.io/devcontainers/features/common-utils:2": {},
7+
"ghcr.io/devcontainers/features/azure-cli:1": {},
8+
"ghcr.io/devcontainers/features/github-cli:1": {}
9+
},
10+
11+
"customizations": {
12+
"vscode": {
13+
"extensions": [
14+
"davidanson.vscode-markdownlint",
15+
"ms-vscode.powershell",
16+
"streetsidesoftware.code-spell-checker",
17+
"redhat.vscode-yaml"
18+
]
19+
}
20+
},
21+
22+
"settings": {
23+
"terminal.integrated.defaultProfile.linux": "pwsh"
24+
},
25+
26+
"postCreateCommand": "pwsh .devcontainer/post-create.ps1"
27+
}

.devcontainer/post-create.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# post-create.ps1
2+
3+
Write-Host "Running DevContainer post-create setup..."
4+
5+
# Ensure scripts can run
6+
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
7+
8+
# Install/update PSResourceGet side-by-side
9+
Write-Host "Installing PSResourceGet..."
10+
Install-Module Microsoft.PowerShell.PSResourceGet -Force -AllowClobber
11+
12+
# Install common modules used in this environment
13+
$requiredModules = @(
14+
"Pester",
15+
"Az.Accounts"
16+
)
17+
18+
Write-Host "Installing required modules..."
19+
foreach ($module in $requiredModules) {
20+
Install-Module $module -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
21+
}
22+
23+
# Validate installation
24+
foreach ($module in $requiredModules) {
25+
if (-not (Get-Module -ListAvailable -Name $module)) {
26+
Write-Warning "Module [$module] did NOT install successfully!"
27+
}
28+
}
29+
30+
# Display installed versions for debugging
31+
Write-Host "Installed module versions:"
32+
33+
Get-Module -ListAvailable |
34+
Where-Object { $_.Name -in $requiredModules + "Microsoft.PowerShell.PSResourceGet" } |
35+
Sort-Object Name, Version |
36+
Format-Table Name, Version, ModuleBase

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
### Added
99

10+
- Added GitHub Codespaces and DevContainerSupport (Non Functional Change)
1011
- Added function `Update-FabricCapacity`
1112
- Added Error Detailed Info in `Test-FabricApiResponse` (Debug mode) when `response.error` exists
1213

0 commit comments

Comments
 (0)