學習如何在 Windows PowerShell 終端機中下載網路檔案。
如何在 PowerShell 中透過 URL 下載檔案(詳細步驟)
- 第 1 步:開啟 PowerShell 視窗 — 按下快速鍵
Win + X並選擇「PowerShell」或「終端機 (Terminal)」。 - 第 2 步:執行 Invoke-WebRequest 指令 — 執行如下指令:
Invoke-WebRequest -Uri "https://abctool.info" -OutFile "destination.zip" # 更改檔案名稱與副檔名 - 第 3 步:檢查輸出檔案 — 檢視目前目錄或目標資料夾中儲存的檔案。
使用 Start-BitsTransfer 進行背景非同步傳輸
對於大檔案下載,使用 Windows 內建的背景智慧型傳送服務(BITS)更為穩定,即使網路中斷也會自動重試:
Start-BitsTransfer -Source "https://abctool.info" -Destination "destination.zip"