Skip to content

#1135: Add PowerShell environment initialization - #2232

Open
cap-juan wants to merge 1 commit into
devonfw:mainfrom
cap-juan:feature/1135-set-env-vars-powershell
Open

#1135: Add PowerShell environment initialization#2232
cap-juan wants to merge 1 commit into
devonfw:mainfrom
cap-juan:feature/1135-set-env-vars-powershell

Conversation

@cap-juan

@cap-juan cap-juan commented Jul 29, 2026

Copy link
Copy Markdown

This PR fixes #1135

Implemented changes:

  • Added PowerShell shell integration for IDEasy.
  • Added automatic IDEasy environment initialization when PowerShell starts inside an IDEasy project.
  • Added PowerShell equivalents for the existing ide, icd, and claude shell functions.
  • Added PowerShell command completion support where supported by the installed PowerShell version.
  • Added automatic configuration and cleanup of the current user's PowerShell profile during installation and uninstallation.
  • Added functions.ps1 to the IDEasy installation artifacts.
  • Kept the PowerShell behavior aligned with the existing Bash integration.

Testing instructions

  1. Check out the PR branch and build/install IDEasy using the normal local development workflow.

  2. Verify that the PowerShell integration script was installed:
    Test-Path "$env:IDE_ROOT\_ide\installation\functions.ps1"

  3. The command should return True.

  4. Close all existing PowerShell sessions.

  5. Open a new PowerShell window directly inside an IDEasy project.

  6. Verify that ide is loaded as a PowerShell function:
    Get-Command ide

  7. The command type should be Function.

  8. Verify that the IDEasy environment was initialized automatically:

$env:IDE_HOME
$env:MAVEN_ARGS
  1. Both variables should contain the values for the current IDEasy project.

  2. Verify that Maven can be executed without running ide first:
    mvn --version

  3. Verify manual environment refresh after changing directories:

Set-Location "$env:IDE_ROOT"
Set-Location "$env:IDE_ROOT\IDEasy"
ide
$env:MAVEN_ARGS
  1. MAVEN_ARGS should be set after running ide.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

Checklist for tool commandlets

Have you added a new «tool» as commandlet? There are the following additional checks:

  • The tool can be installed automatically (during setup via settings) or via the commandlet call
  • The tool is isolated in its IDEasy project, see Sandbox Principle
  • The new tool is added to the table of tools in LICENSE.asciidoc
  • The new commandlet is a command-wrapper for «tool»
  • Proper help texts for all supported languages are added here
  • The new commandlet installs potential dependencies automatically
  • The variables «TOOL»_VERSION and «TOOL»_EDITION are honored by your commandlet
  • The new commandlet is tested on all platforms it is available for or tested on all platforms that are in scope of the linked issue

@CLAassistant

CLAassistant commented Jul 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cap-juan
cap-juan force-pushed the feature/1135-set-env-vars-powershell branch from 4a19b62 to 2d5eee9 Compare July 29, 2026 12:02
@cap-juan
cap-juan force-pushed the feature/1135-set-env-vars-powershell branch from 2d5eee9 to d7bac43 Compare July 29, 2026 12:04
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30450098251

Coverage increased (+0.04%) to 72.632%

Details

  • Coverage increased (+0.04%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 77 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

77 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/IdeasyCommandlet.java 76 76.27%
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%

Coverage Stats

Coverage Status
Relevant Lines: 17062
Covered Lines: 12922
Line Coverage: 75.74%
Relevant Branches: 7635
Covered Branches: 5016
Branch Coverage: 65.7%
Branches in Coverage %: Yes
Coverage Strength: 3.21 hits per line

💛 - Coveralls

@cap-juan
cap-juan requested a review from samuelkos17 July 29, 2026 13:21
@cap-juan cap-juan moved this from 🆕 New to Team Review in IDEasy board Jul 30, 2026
@cap-juan cap-juan added enhancement New feature or request PowerShell Windows PowerShell integration and support ready-to-implement labels Jul 30, 2026
@cap-juan cap-juan self-assigned this Jul 30, 2026
@samuelkos17 samuelkos17 self-assigned this Jul 31, 2026

@samuelkos17 samuelkos17 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job! IMHO this is a nice implementation which adds the functionality requested in #1135. I've ran through your test instructions and everything worked perfectly fine. I have a small suggestion though concerning your method structure. Also you could think about adding tests for the changes you made.

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

Labels

enhancement New feature or request PowerShell Windows PowerShell integration and support ready-to-implement

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

IDEasy does not set env variables on Windows PowerShell

4 participants