Skip to content

Commit 60d1f53

Browse files
committed
[powershell] - Add lts and remove deprecated versions.
1 parent c85af4d commit 60d1f53

3 files changed

Lines changed: 33 additions & 4 deletions

File tree

src/powershell/devcontainer-feature.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "powershell",
3-
"version": "1.5.1",
3+
"version": "1.6.0",
44
"name": "PowerShell",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/powershell",
66
"description": "Installs PowerShell along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
@@ -9,10 +9,10 @@
99
"type": "string",
1010
"proposals": [
1111
"latest",
12+
"lts",
1213
"none",
13-
"7.4",
14-
"7.3",
15-
"7.2"
14+
"7.5",
15+
"7.4"
1616
],
1717
"default": "latest",
1818
"description": "Select or enter a version of PowerShell."

test/powershell/scenarios.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"image": "mcr.microsoft.com/devcontainers/base:noble",
44
"features": {
55
"powershell": {
6+
"version": "lts",
67
"modules": "az.resources, az.storage",
78
"powershellProfileURL": "https://raw.githubusercontent.com/codspace/powershell-profile/main/Test-Profile.ps1"
89
}
@@ -31,6 +32,14 @@
3132
"powershell": {}
3233
}
3334
},
35+
"validate_powershell_installation_spec": {
36+
"image": "mcr.microsoft.com/devcontainers/base:noble",
37+
"features": {
38+
"powershell": {
39+
"version": "7.5"
40+
}
41+
}
42+
},
3443
"powershell_alma_linux": {
3544
"image": "almalinux:9",
3645
"features": {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library for `check` command
6+
source dev-container-features-test-lib
7+
8+
# Extension-specific tests
9+
check "pwsh file is symlink" bash -c "[ -L /usr/bin/pwsh ]"
10+
check "pwsh symlink is registered as shell" bash -c "[ $(grep -c '/usr/bin/pwsh' /etc/shells) -eq 1 ]"
11+
check "pwsh target is correct" bash -c "[ $(readlink /usr/bin/pwsh) = /opt/microsoft/powershell/7/pwsh ]"
12+
check "pwsh target is registered as shell" bash -c "[ $(grep -c '/opt/microsoft/powershell/7/pwsh' /etc/shells) -eq 1 ]"
13+
check "pwsh owner is root" bash -c "[ $(stat -c %U /opt/microsoft/powershell/7/pwsh) = root ]"
14+
check "pwsh group is root" bash -c "[ $(stat -c %G /opt/microsoft/powershell/7/pwsh) = root ]"
15+
check "pwsh file mode is -rwxr-xr-x" bash -c "[ $(stat -c '%A' /opt/microsoft/powershell/7/pwsh) = '-rwxr-xr-x' ]"
16+
check "pwsh is in PATH" bash -c "command -v pwsh"
17+
18+
# Report result
19+
reportResults
20+

0 commit comments

Comments
 (0)