So I will keep this one short and sweet.

It’s a simple script to run a webserver in Powershell which serves a file, hold on what? good gawd why, you say!?!?! because powershell that’s why!

PS: It’s not my first rodeo with the light weight Powershell web server.

Anyone which works in large enterprise knows how painful it can get switching between various proxies depending on what you need to connect to…. so a local PAC file works wonders 🙂

The only problem for windows users is that you can’t specify a file system path in address within Internet Options, it needs to be hosted on a webserver!!!

Who the hell wants to run a full blown webserver just to host a little PAC file!!! soooooo… Powershell to the rescue!!!!!!

Where is the code you ask??? because WordPress and “code” don’t age well in posts, you will find my script over in my git repo.

So how do you use it you ask? Create a scheduled tasks in Microsoft Task Scheduler to run PowerShell and the script at system startup… confirm it’s running and does not stop

Set the proxy setting in windows to http://localhost:8080/pac and bob is your uncle again! IE is happy and the pac is being loaded.

Hope this was helpful.

vMan