2026年4月12日 星期日

Powershell 無法建立 SSL/TLS 的安全通道

解決方法是強制啟用 TLS 1.2

檢查當前 PowerShell 使用的安全性協定

[Net.ServicePointManager]::SecurityProtocol

在指令碼上方加入

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

沒有留言:

PowerShell 無法執行腳本

查看目前的執行原則 Get-ExecutionPolicy 預設原則為Restricted,也就是受到限制的意思,所以造成你無法執行Powershell的腳本。 PowerShell 執行原則共有七個: AllSigned: 可執行已簽署的腳本 Bypass: 不會封鎖任何項目,...