From 2c2c6dd950893745487f0ef75d951470e3594893 Mon Sep 17 00:00:00 2001 From: YiXuan Ding <1328032567@qq.com> Date: Sun, 27 Oct 2024 15:36:15 +0800 Subject: [PATCH] : suppress event output. --- tool/install.ps1 | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/tool/install.ps1 b/tool/install.ps1 index d3b1ab7..19f30ba 100644 --- a/tool/install.ps1 +++ b/tool/install.ps1 @@ -166,23 +166,6 @@ function DownLoad { } } -# function DownLoad { - -# try { -# [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -# Invoke-WebRequest -Uri $url -Method Head | ` -# Where-Object -FilterScript { $_.StatusCode -ne 200 } # 检查状态码是否为 200 -# } -# catch { -# Write-Host "Unable to download ${binary_name}. Please check your internet connection." -# exit 1 # 下载失败,输出错误信息并退出 - -# } -# Invoke-WebRequest -OutFile $path $url -# Write-Host "Downloading $binary_name ($arch architecture, $platform platform, version $version) to $path" -# Write-Host "🎉 Installation completed, path: $path_to_executable" -# } - # 定义清理函数 function Cleanup { if ($flag -eq 1) { @@ -194,7 +177,7 @@ function Cleanup { } # 注册退出事件 -Register-EngineEvent PowerShell.Exiting -Action { Cleanup } +$null = Register-EngineEvent PowerShell.Exiting -Action { Cleanup } # 下载chsrc