Replies: 4 comments
-
|
At least to me it's unclear what you're proposing with respect to what could be done on the PowerShell side. Note that, despite what https://github.com/cea-hpc/modules/blob/main/INSTALL-win.rst states,
Not only is this inefficient, but it implies that anyone relying on this feature must be prepared to have it situationally preempted, namely if a command with this exact name is present, including an external executable. In fact, a warning to this effect and a recommendation not to use the feature can be found in the about_Parsing help topic.
|
Beta Was this translation helpful? Give feedback.
-
|
If you want PowerShell integration then it sounds like you want to be able to change the environment variables while in PowerShell, this can only be done with a PowerShell script, cmdlet or dotnet assembly. PowerShell is neither a POSIX shell, or an extension of CMD.EXE, so scripts and batch/command files have no effect on the PowerShell environment. As noted, the word I suggest that what you need is a PowerShell module for your "Environment Modules" that exposes cmdlets for managing the environment according to your module definitions. For example, you may have one called For integration with PowerShell I recommend respecting the existing naming and conventions within PowerShell and also consulting the Approved Verbs for PowerShell. |
Beta Was this translation helpful? Give feedback.
-
|
While I don't know the specifics of how module works, its commands do run in-process in PowerShell, via PowerShell functions defined in https://github.com/cea-hpc/modules/blob/main/init/pwsh.ps1.in That is, it is designed to support a number of shells, including PowerShell (albeit seemingly a WIP), by running shell-specific code in-process, which is the fundamental prerequisite for modifying a shell session's environment variables, with a unified set of command names across all supported shells. No noun has special status in PowerShell; you can pass any string to While there are conventions for what to call things, the nouns used by PowerShell itself are so generic that ( @TaiXeflar, apart from the
|
Beta Was this translation helpful? Give feedback.
-
|
Converting to a discussion since there doesn't seem to be a suggested action item. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary of the new feature / enhancement
I'm Windows ↔ Linux user with both development OS are using. I found something fun: Environment Modules is starting support pwsh for a while, but it seems support not quite well as it in a early develop state.
This toy is based on tcl/tk, targeting environment variable "Hot-Swapping/Plugging" for development toolchain invocation, commonly can see it on cluster grade HPC Linux servers, no need to call
sysdm.cplGUI for adding PATH/include/lib(I think lots of Windows users have DEJA VU on this maybe).If this feature is supported to both project, it may provide more development benifits and lower the difficulty on Windows develop(Like 3rd party can write Tclsh script into Windows installer for this feature).
The cea-hpc develop team have documentation marked we need to install tcl/tk redistribution like Active TCL or something have
tclsh.exeso it will works incmd.exe. The current state is CMD can use but not good experience then shell environment.Proposed technical implementation details (optional)
As a preview for powershell users can have same experience when using modules usage, I just make a dry-run-like result to show what happens in macOS/Linux/BSD shell so what pwsh will be looks like if this feature is supported.
Assume have a server called foo, with some specified libraries, apps and intel oneAPI installed. Calling module to list all modules be like:
In usual, intel oneAPI toolchain won't be add to user's profile file PATH variable:
So we need to load its module:
The compiler toolchain and it's dependecy libraries/runtimes are loaded. Check PATH variable again:
Now what we foreseen in pwsh will be like:
Remind pwsh conflicts keyword
moduleto environment modules. Here invokes is cmd script for module calling.Beta Was this translation helpful? Give feedback.
All reactions