Anyone know how I can modify the DownloadString below so I can pass basic auth credentials as well?
I am using the same technique used for PsGet (http://psget.net/) to download my own internal scripts and execute them on the fly. However my server is secured using basic auth. I am having trouble applying the credentials and still executing the line using Invoke-Expression.
I need it in one line as I am executing it using "powershell.exe -Command..."
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex