Just the Tip - Powershell Invoke-WebRequest Curl Wget PortableApps Expand-Archive

Just the Tip - Powershell Invoke-WebRequest Curl Wget PortableApps Expand-Archive

Cyber Secrets Quick Tip br br # Problem: I need a script to download files from the internet and if they are programs, run them. br br # Solution: Either Powershell's Invoke-WebRequest or Curl br br $source = "" br $source2 = "" br $destination = "$env:TEMP\ATC-Web20-Logo.png" br $destination2 = "$env:TEMP\Jeremy-Martin.jpg" br br #download with invoke-webrequest br Invoke-WebRequest $source -OutFile $destination -ErrorAction Stop br br #download a file with curl br curl $source2 -OutFile $destination2 br br #run the program Invoke-Item br Invoke-Item $destination br br #run the program with Start-Process br Start-Process -FilePath $destination2 -PassThru br br #Add a registry key br new-itemproperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -name StartMe -value $destination -ErrorAction SilentlyContinue br br ---- br br # IWC Custom PortableApps Builder br # Author: Jeremy Martin br # jeremy@informationwarfarecenter.com br br # Download PortableApps and install br # Ask for where the PortableApps is installed br clear br $source = "" br $destination = "$env:TEMP\installer.exe" br Invoke-WebRequest $source -OutFile $destination br Start-Process -FilePath "$destination" -PassThru br $PA = Read-Host -Prompt "Where did you install PortableApps (Example d:\PortableApps)" br br # IWC Extra files br echo "Downloading IWC Extra Apps" br $Source2 = "" br $destination2 = "$env:TEMP\IWC-Extras.zip" br curl $Source2 -OutFile $destination2 br Expand-Archive –Path $destination2 -DestinationPath "$PA\PortableApps" -Force br Start-Process -FilePath "$PA\Start.


User: Cyber Secrets

Views: 4

Uploaded: 2017-07-31

Duration: 02:00

Your Page Title