diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-06 16:16:56 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-03-06 16:18:24 -0800 |
| commit | 3eb0526468d07824900c462ccfacdeffd7fa1969 (patch) | |
| tree | d184427313467d92788b99d27d65064e890f197b /toolsrc/src/vcpkg_System.cpp | |
| parent | 7f3153bd62a24b1235a98d68d9aac1b00ba1228f (diff) | |
| download | vcpkg-3eb0526468d07824900c462ccfacdeffd7fa1969.tar.gz vcpkg-3eb0526468d07824900c462ccfacdeffd7fa1969.zip | |
Properly handle spaces in path when calling powershell script
Diffstat (limited to 'toolsrc/src/vcpkg_System.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg_System.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 679318768..9609d819b 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -49,6 +49,17 @@ namespace vcpkg::System return { ec, output }; } + std::wstring create_powershell_script_cmd(const fs::path& script_path) + { + return create_powershell_script_cmd(script_path, L""); + } + + std::wstring create_powershell_script_cmd(const fs::path& script_path, const std::wstring& args) + { + // TODO: switch out ExecutionPolicy Bypass with "Remove Mark Of The Web" code and restore RemoteSigned + return Strings::wformat(LR"(powershell -ExecutionPolicy Bypass -Command "& {& '%s' %s}")", script_path.native(), args); + } + void print(const char* message) { fputs(message, stdout); |
