Quantcast
Channel: Active questions tagged powershell-3.0 - Stack Overflow
Viewing all articles
Browse latest Browse all 120

DownloadString with basic auth similar to psget's

$
0
0

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


Viewing all articles
Browse latest Browse all 120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>