修改 PowerShell 部署脚本以确保成功下载 Microsoft Windows 客户端可执行文件

如果要使用 PowerShell 部署脚本在具有协议限制的环境中安装趋势科技服务器深度安全防护系统客户端,则当脚本尝试下载适用于 Microsoft Windows 的趋势科技服务器深度安全防护系统客户端 agent.msi 可执行文件时,可能会遇到以下错误:

使用 "2" 参数调用 "DownloadFile" 时出现异常:“基础连接已关闭:发送时发生意外错误。”(Exception calling "DownloadFile" with "2" argument(s): "The underlying connection was closed: An unexpected error occurred on a send.")

要确保部署脚本能够下载该可执行文件,请将以下行添加到脚本的开头,以将安全协议设置为 TLS 1.2:

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