Windows10: 使用提供的 powershell 脚本注册 filebeat 服务时出现问题

Windows 10: Problem on registering filebeat service using provided powershell script

我想注册并使用 File Beats 作为一项 windows 服务。

所以,我运行官网提供的服务注册脚本,但是出现了错误

错误:PSSecurityException(未授权访问)

我的系统os版本是Windows10,我想安装7.10.0版的Filebeat

请多多指教

首先,您必须设置执行策略以获得权限

你可以试试这个:

PS> Set-ExecutionPolicy Unrestricted

现在,您可以使用提供的 powershell 脚本。

PS> .\install-service-filebeat.ps1

执行脚本后必须启动服务

PS> Start-Service filebeat 

如果要删除执行策略,请使用此命令:

PS> Set-ExecutionPolicy Undefined

我检查过此命令可以与 Filebeat 7.10.0 和 Windows 10 环境一起使用。

谢谢。祝你有美好的一天:)