-
首先,需要打开Windows中自带的powershell。
可以通过在cmd中输入start powershell打开;
也可以在【开始】中,通过搜索找到并打开powershell。
-
在打开的poershell窗口中,依次输入如下命令:
$client = new-object System.Net.WebClient (按回车)
$client.DownloadFile('#1','#2') (按回车)
其中,在实际应用中:
'#1'需要用网络文件位置替代;
'#2'需要用保存到本地后的路径+文件名替代。
比如,$client.DownloadFile('http://test.com/xxx.html','D:\index.html')
-
命令执行后,指定网络位置的文件(比如http://test.com/xxx.html)就被保存为D盘的index.html文件。
如何使用window powershell下载网址中的资源
最新推荐文章于 2023-08-29 15:58:21 发布