Skip to content
Snippets Groups Projects
Commit 34b4820e authored by Benno Fünfstück's avatar Benno Fünfstück
Browse files

HttpUtils: pass powershell script via stdin

The powershell script contains the password, so writing it to a file
is a bit unsafe. We know pass it via stdin.
This commit also improves the error message for network failures a
little bit.
parent 8e894d99
No related branches found
No related tags found
No related merge requests found
......@@ -553,9 +553,12 @@ powershellTransport prog =
-- the default execution policy doesn't allow running
-- unsigned scripts, so we need to tell powershell to bypass it
, "-ExecutionPolicy", "bypass"
, "-File", tmpScriptFile
, "-NoProfile", "-NonInteractive"
, "-Command", "-"
]
getProgramInvocationOutput verbosity (programInvocation prog args)
{ progInvokeInput = Just (script ++ "\nExit(0);")
}
escape = show
......@@ -597,12 +600,10 @@ powershellTransport prog =
, " Write-Host ($response.StatusCode -as [int]);"
, " Write-Host $reader.ReadToEnd();"
, " } Else {"
, " Write-Error $exception.Message;"
, " Exit(1);"
, " Write-Host $exception.Message;"
, " }"
, "} Catch {"
, " Write-Error $_.Exception.Message;"
, " Exit(1);"
, " Write-Host $_.Exception.Message;"
, "}"
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment