文章作者:Micropoor
原文链接:https://micropoor.blogspot.com
自Windows7以后内置了powershell,如Windows 7中内置了PowerShell2.0, Windows 8中内置了PowerShell3.0。
靶机:windows 7
powershell $PSVersionTable
down.ps1:
基于System.Net.WebClient
附:
$Urls = @()
$Urls += "http://192.168.1.115/robots.txt"
$OutPath = "E:\PDF\"
ForEach ( $item in $Urls) {
$file = $OutPath + ($item).split('/')[-1]
(New-Object System.Net.W
ebClient).DownloadFile($item, $file)
}
靶机:
windows 2012
powershell $PSVersionTable
down.ps1:
在powershell 3.0以后,提供wget功能,既Invoke-WebRequest
C:\inetpub>powershell C:\inetpub\down.ps1
注:需要绝对路径。
附:
当然也可以一句话执行下载:
你可能喜欢