Fail to initialize conda in latest PowerShell Preview
On Powershell 7.5 preview 4, after conda activate base, Env:_CE_CONDA and Env:_CE_M appears again.
$Env:_CE_M = $null $Env:_CE_CONDA = $nullInvoke-Conda函数function Invoke-Conda() {
# Don't use any explicit args here, we'll use $args and tab completion
# so that we can capture everything, INCLUDING short options (e.g. -n).
if ($Args.Count -eq 0) {
# No args, just call the underlying conda executable.
& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA;
}
else {
$Command = $Args[0];
if ($Args.Count -ge 2) {
$OtherArgs = $Args[1..($Args.Count - 1)];
} else {
$OtherArgs = @();
}
switch ($Command) {
"activate" {
Enter-CondaEnvironment @OtherArgs;
$Env:_CE_M = $null; $Env:_CE_CONDA = $null;
}
"deactivate" {
Exit-CondaEnvironment;
$Env:_CE_M = $null; $Env:_CE_CONDA = $null;
}
default {
# There may be a command we don't know want to handle
# differently in the shell wrapper, pass it through
# verbatim.
& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA $Command @OtherArgs;
}
}
}
}