18 lines
647 B
PowerShell
18 lines
647 B
PowerShell
$serviceName="ZeroTierOneService"
|
|
$statusList=@("Stopped","StopPending")
|
|
|
|
#Comprobando que el servicio existe, recuperando su objeto
|
|
$service=Get-Service "$serviceName"
|
|
if ($? -eq $false){
|
|
exit
|
|
}
|
|
|
|
#Comprobando el estado
|
|
if (-Not ($statusList -contains $service.Status)) {
|
|
Stop-Service $service
|
|
Stop-Process -Name "zerotier_desktop_ui"
|
|
} else {
|
|
Start-Service $service
|
|
#Tremendo hardcodeo, fuck it, se mete el solo sin opcion en el menu de inicio, me la come Y POR QUE EL NOT NECESITA SU PROPIO PARENTESIS POWERSHEEEEL
|
|
Start-Process -FilePath "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ZeroTier"
|
|
}
|