PowerShell Web Server for File Transmission

This script will deploy a temporary web server on the local system and will listen on the port of your choice. Once it is listening, you will be able to transfer .txt and .html files from the directory in which the script is ran from (not located). The web server will continue to run as long as the script is running.

To execute, run the script and when prompted, input a port to listen on. To access the system and the data in the directory that the script ran from, use the below syntax from another system.

Invoke-WebRequest http:/:/file_in_dir.txt -OutFile downloaded_data.txt

Example: “Invoke-WebRequest http:/192.168.1.1:8001/passwords.txt -OutFile passwords.txt”

This PowerShell script can be found in my script repo on the right-hand side of the screen.