diff --git a/libmamba/src/core/activation.cpp b/libmamba/src/core/activation.cpp index da261b0926..afc6b4abb0 100644 --- a/libmamba/src/core/activation.cpp +++ b/libmamba/src/core/activation.cpp @@ -709,7 +709,15 @@ namespace mamba auto has_prefix = util::get_env("CONDA_PREFIX"); if (m_context.auto_activate_base && !has_prefix.has_value()) { - builder << get_self_exe_path().stem() << " activate base\n"; + // use invocation operator to run commands represented by strings + if (is_powershell(this)) + { + builder << "& " << get_self_exe_path().stem() << " activate base\n"; + } + else + { + builder << get_self_exe_path().stem() << " activate base\n"; + } } builder << hook_postamble() << "\n"; return builder.str();