IT Knowledge Base

~ Freedom is the right of all sentient beings ~

發佈日期:

如何利用『Fido.ps1』‧下載Windows 11 ISO檔案‧及如何解決『PowerShell』在Windows被禁止執行情況

01. 『Fido.ps1』是一套能用PowerShell指令,下載Windows 11 ISO檔案。


02. 但今天想用來下載Windows 11 ISO檔案,卻出現了『因為這個系統上已停用指令碼執行,所以無法載入Fido.ps1檔案』錯誤。

03. 找到錯誤提及的網頁,原來是Windows的保護機制。

04. 執行『Get-ExecutionPolicy』指令,便會看到『Restricted』,即是現時系統設定為禁止執行PowerShell指令。執行『Get-ExecutionPolicy -List』指令,便會看到相關禁止執行PowerShell指令詳情。

05. 因為今次只執行一次『Fido.ps1』,所以我只容許現時Windows用戶,執行PowerShell指令。輸入『Set-ExecutionPolicy -ExecutionPolicy Allsigned -Scope CurrentUser』,再執行『Get-ExecutionPolicy』指令檢查,便會看到現時用戶,可被容許執行PowerShell指令。

06. 再次執行『Fido.ps1』,便會看到證書警告。這是因為證書是自行簽發,所以執行時,用戶需確認有關PowerShell程式是安全。

07. 按步驟選取相關下載選項。




08. 最後便會見到結果,今次執行錯誤是『We are unable to complete your request at this time. Some users, entities and locations are banned from using this service.』。此錯誤其不是『Fido.ps1』做成,而是Microsoft伺服器限制了相關下載,用戶只能之後再作測試。

09. 而『Fido.ps1』程式,可以用不同指令,檢查可下載選項。

10. 最後,用PowerShell指令『Set-ExecutionPolicy -ExecutionPolicy UnDefined -Scope CurrentUser』,禁止現時用戶再執行PowerShell指令。

11. 如成功連接到Microsoft伺服器,便會根據設定,下載相關Windows ISO檔案。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *