Surprise Me!

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

2017-07-31 4 Dailymotion

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 = "https://www.informationwarfarecenter.com/images/ATC-Web20-Logo.png" <br />$source2 = "https://www.informationwarfarecenter.com/images/Jeremy-Martin.jpg" <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 = "https://portableapps.com/redirect/?a=PAcPlatform&t=http%3A%2F%2Fdownloads.portableapps.com%2Fportableapps%2Fpacplatform%2FPortableApps.com_Platform_Setup_14.4.1.paf.exe" <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 = "https://www.informationwarfarecenter.com/files/IWC-Extra-Apps.zip" <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.exe" -PassThru

Buy Now on CodeCanyon