How can I source variables from a .bat file into a PowerShell script?

后端 未结 5 1450
春和景丽
春和景丽 2020-12-10 02:25

I\'m replacing parts of a .bat script with PowerShell. Configuration for the batch files is done via files that set appropriate environment variables. I\'m look

5条回答
  •  盖世英雄少女心
    2020-12-10 02:51

    If you are using the PowerShell Community Extensions, it has a Invoke-BatchFile that does this. I use with the Visual Studio vcvarsall.bat file to configure my PowerShell session to use the Visual Studio tools.

提交回复
热议问题