Windows PowerShell trong Windows 10, là công cụ mạnh mẽ có khả năng gấp nhiều lần Command Prompt. Nó thậm chí có thể thay thế Command Prompt trong tương lai gần vì cung cấp nhiều quyền lực và kiểm soát hơn đối với hệ điều hành. Microsoft phát triển nó cho tự động hóa tác vụ và quản lý cấu hình. Dựa trên .NET Framework, nó bao gồm giao diện dòng lệnh và ngôn ngữ kịch bản.
Tải file bằng PowerShell
Hôm nay, chúng ta sẽ dùng Windows PowerShell để tải file từ Internet với các lệnh đơn giản. Làm theo các bước dưới:
- Mở PowerShell console với quyền admin. Nhấn Windows Key gõ powershell. Chuột phải Windows Powershell (Desktop App) chọn Run as administrator. Chọn Yes trong cửa sổ UAC.
- Bây giờ, bạn cần sao chép link file muốn tải bằng PowerShell. Xem hình dưới ví dụ:

- Sao chép và dán lệnh sau vào Notepad.
$client = new-object System.Net.WebClient $client.DownloadFile(“Download Link”,”File Destination\file name.file extension”)
- Trong lệnh trên, thay Download Link bằng link bạn copy ở Bước 2. Chèn đường dẫn tải xuống cùng tên file muốn lưu, kèm phần mở rộng, thay cho File Destination\file name.file extension.
KHÔNG xóa dấu ngoặc kép. Xem ví dụ sửa lệnh:
$client = new-object System.Net.WebClient $client.DownloadFile(“https://thewindowsclub.thewindowsclub.netdna-cdn.com/wp-content/upload/2016/Windows-Explorer-Process-Task-Manager-600x405.png”,”C:\Users\Digdarshan\Pictures\TWC\Task-Manager.png”)
- Sao chép lệnh đã sửa và dán vào cửa sổ PowerShell. Nhấn Enter để tải file.

- Xong! Bạn có thể vào thư mục tải xuống để tìm file lưu đó.

Nếu tải file cần thông tin xác thực như đăng nhập server v.v., dùng lệnh sau để tải một lần:
$client = new-object System.Net.WebClient $client.Credentials = Get-Credential $client.DownloadFile(“https://thewindowsclub.thewindowsclub.netdna-cdn.com/wp-content/upload/2016/Windows-Explorer-Process-Task-Manager-600x405.png”,”C:\Users\Digdarshan\Pictures\TWC\Task-Manager.png”)
Hãy cho biết trong phần bình luận nếu gặp vấn đề khi tải file.
