search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell | 5 Comments | 7,580 views | 31/05/2009 08:32

You can connect to secure web pages with powershell using your username and password.

1
2
3
4
5
6
7
$url = "http://secure.yusufozturk.info/secured_page.aspx"
$username = "ysfozy"
$pass = "my_password"
$domain = "DOMAIN"
$webclient = new-object System.Net.WebClient
$webclient.Credentials = new-object System.Net.NetworkCredential($username, $pass, $domain)
$webpage = $webclient.DownloadString($url)

Simply use write-host to see contents of the web page.