Skip to content

Support for PowerShell/pwsh #326

Description

@kheaactua

Is your feature request related to a problem? Please describe.

Being able to use PowerShell/pwsh with Environment Modules would be really helpful

Describe the solution you'd like

The ability for Environment Modules to interact with the $env object.

Additional context

I was able to install Environment Modules using the WSL to build it (15158c3) and then running INSTALL.bat, and then even set up a PS function to use module, i.e.

$env:MODULESHOME = "$env:HOMEPATH\workspace\modules\install"
if (Test-Path $env:MODULESHOME)
{
	$env:MODULES_CMD="$env:MODULESHOME\libexec\modulecmd.tcl"
	function module	{
		&"$env:MODULESHOME\bin\module.cmd" $args
	}
	
	$my_modules = "$env:HOMEPATH\dotfiles\modulefiles";
	if (Test-Path $my_modules)
	{
		write-host " Adding $my_modules" -ForegroundColor Yellow
		$env:MODULEPATH="$my_modules" # module use doesn't seem to work
	}
}

But at the end of the day I don't think Environment Modules is able to interact with the environment properly. Even even I got module load sort of working (using a full path because it can't seem to read MODULESHOME, it can't write to my environment.

It seems like it's so close to working. It works in CMD, I just never use CMD..

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions