Powershell muda temporariamente o caminho para a sessão

1

Estou escrevendo um script PowerShell para configurar algumas coisas do ambiente python e executar algum código. Eu me deparei com um problema no início com virtualenvwrapper-powershell não Instalando para python3 ( virtualenv installs / funciona bem por conta própria).

Eu não preciso da funcionalidade completa de virtualenvwrapper-powershell , eu sei que pode simular muito bem, alterando qual python é usado quando o comando python (e pip etc) é usado. Se eu puder alterar o valor do caminho dentro da sessão de powershell atual ou apenas dentro do script, poderei sobreviver, mas não quero fazer alterações no caminho permanente ou no sistema inteiro. Existe alguma maneira de fazer isso?

    
por Paul Nelson Baker 01.08.2016 / 18:44

1 resposta

1

Trecho da ajuda do Windows PowerShell:

  To make a persistent change to an environment variable, use System in
  Control Panel (Advanced tab or the Advanced System Settings item) to
  store the change in the registry.

  When you change environment variables in Windows PowerShell, the change
  affects only the current session. This behavior resembles the behavior
  of the Set command in Windows-based environments and the Setenv command
  in UNIX-based environments.

Para detalhes completos, digite o seguinte comando:

get-help environment -ShowWindow
    
por 01.08.2016 / 18:55