- $serviceName ="XYY.WindowsService.ReshMQ";
function installService
{
Write-Warning "安装服务";
.\XYY.WindowsService.ReshMQ install;
}
function uninstallService
{
Write-Warning "卸载服务";
.\XYY.WindowsService.ReshMQ uninstall;
}
Get-Service $serviceName -ErrorAction SilentlyContinue;
if($?)
{
Write-Output ($serviceName)"服务存在";
uninstallService;
installService;
}
else
{
Write-Output ($serviceName)"服务不存在";
installService;
}
|