Skip to content

Commit

Permalink
fix mapname url encoded webclient api better
Browse files Browse the repository at this point in the history
  • Loading branch information
d3nd3 committed May 11, 2023
1 parent e8e48e5 commit 4039ed6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions http_listener.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ While ($true) {

try {
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "$HttpServer$HttpFile" -OutFile $DestFile -ErrorAction Stop
$encodedUri = [System.Uri]::EscapeUriString("$HttpServer$HttpFile")
$webClient = New-Object System.Net.WebClient
$webClient.DownloadFile($encodedUri, $DestFile)
Write-Host "SUCCESS: ""$HttpFile"" downloaded to ""$DestFile""."

# Read-Host -Prompt "Press Enter to continue..."
Expand All @@ -71,7 +73,11 @@ While ($true) {

}
} else {
# $arguments = "-ExecutionPolicy Bypass", "-File `"$PSCommandPath`"", "disappear", "$args"
$arguments = "-WindowStyle Hidden","-ExecutionPolicy Bypass", "-File `"$PSCommandPath`"", "disappear", "$args"
# $arguments = "-ExecutionPolicy Bypass", "-File `"$PSCommandPath`"", "disappear"
$arguments = "-WindowStyle Hidden","-ExecutionPolicy Bypass", "-File `"$PSCommandPath`"", "disappear"

if ($args -ne $null) {
$arguments += $args
}
Start-Process "powershell.exe" -ArgumentList $arguments
}

0 comments on commit 4039ed6

Please sign in to comment.