Tải file PowerShell.zip về và giải nén. File tại đây: https://gallery.technet.microsoft.com/scriptcenter/How-to-automatically-mount-d623ce34
Tham khảo thêm về policy khi chạy script PowerShell: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-6
Chạy PowerShell quyền admin, lệnh: PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope LocalMachine
Tiếp theo gõ lệnh để chạy file moutvhd.ps1 đã giải nén ra ở trên, kèm tham số là đường dẫn đến file vhd trên máy:
ví dụ: PS C:\Windows\system32> C:\Users\kiennd\Downloads\mountvhd.ps1 -path "C:\Ddrive.vhd"
Chạy PowerShell quyền admin, lệnh: PS C:\Windows\system32> Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine
Lệnh view lại policy: Get-ExecutionPolicy -List
No comments:
Post a Comment