winsw.exe install nginx安装过程中出现错误System.Management.ManagementException:Invalid class的解决方案

winsw.exe install nginx安装过程中出现错误System.Management.ManagementException:Invalid class的解决方案

具体错误上图:
winsw.exe install nginx安装过程中出现错误System.Management.ManagementException:Invalid class的解决方案
给出解决方案

开始菜单->power shell以管理员方式打开->cd 至winsw.exe所在目录
运行命令 New-Service -Name “earth-nginx” -BinaryPathName “F:\Grandata\InstallPackage\earth-nginx\nginx.exe”
开始菜单->services 打开服务界面,找到earth-nginx服务并手动启动或者使用命令启动
如需要转载请写明出处