Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PowerShell从重定向的URL下载文件_Url_Download_Powershell 3.0_Url Redirection - Fatal编程技术网

使用PowerShell从重定向的URL下载文件

使用PowerShell从重定向的URL下载文件,url,download,powershell-3.0,url-redirection,Url,Download,Powershell 3.0,Url Redirection,我想知道是否可以从使用powershell脚本重定向的URL下载文件。 (我正在运行Windows 8) 在工作中,我们使用Combofix和其他杂项程序来清除员工计算机中的恶意软件 Combofix经常更新,我们每周都会使用这个程序好几次,我想在我的电脑上总是有最新版本的Combofix会很好 下载URL如下所示: http://www.bleepingcomputer.com/download/combofix/dl/12/ http://download.bleepingcomputer

我想知道是否可以从使用powershell脚本重定向的URL下载文件。 (我正在运行Windows 8)

在工作中,我们使用Combofix和其他杂项程序来清除员工计算机中的恶意软件

Combofix经常更新,我们每周都会使用这个程序好几次,我想在我的电脑上总是有最新版本的Combofix会很好

下载URL如下所示:

http://www.bleepingcomputer.com/download/combofix/dl/12/
http://download.bleepingcomputer.com/dl/50b8cfbdcd418904cebb8e420ca12d36/52e915a4/windows/security/anti-virus/c/combofix/ComboFix.exe
打开URL时,您将被重定向到如下URL:

http://www.bleepingcomputer.com/download/combofix/dl/12/
http://download.bleepingcomputer.com/dl/50b8cfbdcd418904cebb8e420ca12d36/52e915a4/windows/security/anti-virus/c/combofix/ComboFix.exe

我不能多次使用此URL,因为它将在10分钟内过期。

您可以这样做:

$rep=Invoke-WebRequest http://www.bleepingcomputer.com/download/combofix/dl/12/ -MaximumRedirection 0 
$rep.Links | where {$_.innerText -eq "click here"} |select -expand href