$wmi = gwmi win32_networkadapterconfiguration -filter "ipenabled = ‘true‘"
$wmi.EnableStatic("10.0.1.101","255.255.255.0")
$wmi.SetGateways("10.0.1.1",1)
$wmi.SetDNSServerSearchOrder("202.106.0.20")
Set-NetFirewallRule #PS3.0支持
原文:http://www.cnblogs.com/dreamer-fish/p/3892354.html