#2651 fail quietly when removing a non-existing variable #2696
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was discussed in issue #2651
When Powershell starts it runs the $PROFILE script.
micromamba init
updates these profiles (e.g. $profile.CurrentUserAllHosts) with something like the following:When run the following error is produced.
The cause of the error is revealed by running the following command.
Which produces:
While
Mamba.psm1
accepts a missing/emptyArgumentList
, the subsequentRemove-Variable
on the undefined variableMambaModuleArgs
produces the error.I suspect the idea is that
MambaModuleArgs
is presumed to be set outside of theregion mamba initialize
. Therefore, I think the fix should accommodate that inten by changing the powershell shell hook...A related issue is that the documentation is weak on the purpose for
MambaModuleArgs
.It is used in
Mamba.psm1
and where seems to only have one defined entry.