Adding self-signed certificate to PowerShell script compiled as .EXE

How can I add a self-signed certificate to my .exe file when trying to compile a simple PowerShell script into a .EXE using PowerShell Pro Tools in Visual Studio?

Use microsoft product called to “sign tool”.

command line:
signtool sign /f “cert.pfx” /p “password” /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 “application.exe”

please note that cert needs to be valid for code signaturing so if it’s client or server authentication you will get error