Tried to install after setting the execution policy, still facing the same issues. Executed the PS as admin and then executed the below commands:
PS D:\Metricbeat> Set-ExecutionPolicy RemoteSigned
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
PS D:\Metricbeat> PowerShell.exe -ExecutionPolicy RemoteSigned -File .\install-service-metricbeat.ps1
File D:\Metricbeat\install-service-metricbeat.ps1 cannot be loaded. The file
D:\Metricbeat\install-service-metricbeat.ps1 is not digitally signed. You cannot run this script on the current
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: ( [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess