Skip to content

feat: Add support for preserving pwsh history - #1708

Open
Nebula (nebula-it) wants to merge 11 commits into
devcontainers:mainfrom
nebula-it:main
Open

feat: Add support for preserving pwsh history#1708
Nebula (nebula-it) wants to merge 11 commits into
devcontainers:mainfrom
nebula-it:main

Conversation

@nebula-it

Copy link
Copy Markdown
Contributor

No description provided.

@nebula-it
Nebula (nebula-it) requested a review from a team as a code owner August 11, 2026 04:38

@Kaniska244 Kaniska (Kaniska244) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Nebula (@nebula-it)

Thank you for the contribution. The tests are failing to get sudo access while executing the onCreate script you have added for non dev container origin base images.
This is happening because the lifecycle hooks such as onCreateCommand use the default container users to execute the commands and the dev container origin base images have a default user vscode configured with sudo access when isn't the case for other base images. Would you kindly optimize the solution accordingly?

@nebula-it

Copy link
Copy Markdown
Contributor Author

Hey Kaniska (@Kaniska244)

Do you have an example devcontainer.json that I can use to verify that setup? This was working when I tested it locally with a devcontainer.json that just had powershell feature.

@Kaniska244

Copy link
Copy Markdown
Contributor

Hey Kaniska (Kaniska (@Kaniska244))

Do you have an example devcontainer.json that I can use to verify that setup? This was working when I tested it locally with a devcontainer.json that just had powershell feature.

Hi Nebula (@nebula-it)

The sample configuration is already present in /workspaces/features/test/powershell/scenarios.json file. The following test case can be used to reproduce this.

  "powershell_alma_linux": {
    "image": "almalinux:9",
    "features": {
      "powershell": {} 
    }
  }

If you have devcontainers/cli installed, you can use the following command for this with your changes.

devcontainer features test . -f powershell --filter "powershell_alma_linux" --skip-autogenerated --preserve-test-containers

Even better, you can run it with debian trixie(13) basic debian:trixie base image and it should reproduce the same error.

devcontainer features test . -f powershell -i "debian:trixie" --skip-scenarios --preserve-test-containers

Then if you try the dev container debian trixie(13) image mcr.microsoft.com/devcontainers/base:trixie, the error won't come and installation will be successful.

devcontainer features test . -f powershell -i "mcr.microsoft.com/devcontainers/base:trixie" --skip-scenarios --preserve-test-containers

… the file, it does not write error message into $PROFILE.

Remove redundant `sudo` since this script is required to run as root
@nebula-it

Copy link
Copy Markdown
Contributor Author

Kaniska (@Kaniska244) The two failures above seems to be unrelated reasons. Can you please double check

@Kaniska244

Kaniska (Kaniska244) commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Kaniska (Kaniska (@Kaniska244)) The two failures above seems to be unrelated reasons. Can you please double check

Hi Nebula (@nebula-it)

If you scan the log, it's full of "permission denied" errors during test executions such as this. Could you please check?

@Kaniska244 Kaniska (Kaniska244) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replied on previous comment

…plicity setting the read permissions for any user
…s succeding so far because powershell does not complaing about missing var, it'll just not return anything.
@nebula-it

Copy link
Copy Markdown
Contributor Author

Kaniska (@Kaniska244) Fixed.

Also fixed the profile test, which would have always passed no matter if the profile was loaded or not.

@Kaniska244 Kaniska (Kaniska244) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be further reviewed by maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants