Found one way:
$page = (New-Object System.Net.WebClient).DownloadString("http://localhost/")
Thanks to Steven Murawski for his comment:
The best way really depends on what
task you are trying to accomplish as
the two answers below have noted.
WebClient is the simplest, but
HttpWebRequest is the most flexible.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…