feat: command to uninstall all agent services (#30)

* feat: command to uninstall all agent services

* fix: file extension
This commit is contained in:
UUBulb
2024-12-05 17:07:05 +08:00
committed by GitHub
parent 3d31005c61
commit 7ed0dda9dc
2 changed files with 19 additions and 3 deletions

View File

@ -1,5 +1,3 @@
#Get server and key
param($server, $key, $tls)
# Download latest release from github
if($PSVersionTable.PSVersion.Major -lt 5){
Write-Host "Require PS >= 5,your PSVersion:"$PSVersionTable.PSVersion.Major -BackgroundColor DarkGreen -ForegroundColor White
@ -82,6 +80,6 @@ Move-Item -Path "C:\temp\nezha-agent.exe" -Destination "C:\nezha\nezha-agent.exe
Remove-Item "C:\nezha.zip"
Remove-Item "C:\temp" -Recurse
#安装部分
C:\nezha\nezha-agent.exe service install -s $server -p $key $tls
C:\nezha\nezha-agent.exe service install
#enjoy
Write-Host "Enjoy It!" -BackgroundColor DarkGreen -ForegroundColor Red