前陣子更新 Cmder 後,啟動或執行指令時常會卡住一陣子,並出現以下視窗:

回想首次執行 Cmder 時曾跳出解鎖對框,當時我選了 Ignore and Continue,而非 Unblock and Continue:

Windows 有個安全機制,會標註從網路下載來的可執行檔案,加強安全檢查等級。從網路下載 ZIP 解壓縮出來的 exe、dll 也會感染有此註記。

用 PowerShell Get-Content <path> -Stream Zone.Identifier 可查詢到 ZoneId = 3 (Internet),而來源(ReffererUrl)是 用 Edge 下載的 cmder (1).zip;檔案總管屬性也可看到安全性提示,並有個「解除封鎖」選項:

當初提示「Unblock and Continue」就是 Cmder 偵測到註記可由程式解鎖的貼心功能。既然錯過了,自己手動解鎖亦可(提醒:執行前請確認下載程式是安全的),嫌用檔案總管一個個「解除封鎖」太累,用一行 PowerShell 結束這回合。

Get-ChildItem * -Recurse | Unblock-File


Comments

# by 小黑

若黑大開賣PowerShell 線上課程,肯定賣爆,我第一個報名.

Post a comment