Steps to resolve APM - .NET Core Agent's `AgentDiagnoser.ps1` PowerShell Script Execution failure due to Digital Signature Error

Steps to resolve APM - .NET Core Agent's `AgentDiagnoser.ps1` PowerShell Script Execution failure due to Digital Signature Error

When attempting to run a APM - .NET Core Agent PowerShell script "AgentDiagnoser.ps1" to generate agent diagnostics,  you may encounter an error indicating that the script cannot be loaded because it is not digitally signed. This issue can occur due to the system's PowerShell execution policy, which restricts the execution of unsigned scripts for security reasons.



Solution
To resolve this issue and allow the execution of the script, follow these steps:
1. Open PowerShell with administrator privileges.
2. Run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force
This command temporarily bypasses the execution policy for the current PowerShell session, allowing unsigned scripts to be executed. The "-Scope Process" parameter ensures that the change applies only to the current PowerShell session.

After running the command, attempt to execute the PowerShell script again. You should now be able to run the "AgentDiagnoser.ps1" script without encountering the digital signature error.
Note: While bypassing the execution policy temporarily resolves the issue, it may pose security risks. Exercise caution and ensure that the script is from a trusted source before running it.

Additional Resources: For more information about PowerShell execution policies and setting execution policies, refer to the following Microsoft documentation: About Execution Policies

                    New to ADSelfService Plus?