Cách mở PowerShell ở thư mục hiện tại trong Windows

Thêm tùy chọn Open PowerShell Here vào menu ngữ cảnh trên Windows cho phép bạn mở thư mục hiện tại trong cửa sổ PowerShell.
Cách mở PowerShell ở thư mục hiện tại trong Windows

I. Các cách thực hiện

Cách 1: Sử dụng Registry Editor

HKEY_CLASSES_ROOT\Directory\Shell\Open PowerShell Here
powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -Command "Set-Location $PSScriptRoot"

Cách 2: Sử dụng Windows PowerShell (Admin)

New-ItemProperty -Path "HKCU:\Software\Classes\Directory\Shell\Open PowerShell Here" -Name "Command" -Value "powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -Command 'Set-Location $PSScriptRoot'" -PropertyType String

Sau khi thực hiện một trong hai cách trên, tùy chọn Open PowerShell Here sẽ xuất hiện trong menu ngữ cảnh khi bạn nhấp chuột phải vào một thư mục.

II. Một số lưu ý

Ngoài ra, bạn có thể sử dụng các công cụ của bên thứ ba như PowerShell ISE hoặc Explorer++ để thêm tùy chọn "Open PowerShell Here" vào menu ngữ cảnh.

Tham khảo thêm: Các thủ thuật Registry hữu ích cho người dùng Windows

Thông tin bài viết

Bài viết liên quan

Lỗi "Your PC needs to be repaired" trên WindowsCách chuyển dữ liệu giữa các máy tính WindowsCách sửa lỗi DNS Server Not Responding trên WindowsCách ngăn chặn USB lây nhiễm virus vào máy tínhCách kiểm tra RAM và ứng dụng đang chiếm dụng RAM trên MacBookCách sửa lỗi máy tính không khởi động