compile_powershell
This is an old revision of the document!
To Compile the Powershell script into an EXE
Run powershell as administrator, then run
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass Import-Module PS2EXE ps2exe -inputfile 'YourScript.ps1' -outputfile 'YourScript.exe'
To add an icon
ps2exe -inputfile 'YourScript.ps1' -outputfile 'YourScript.exe' -iconfile 'YourIcon.ico'
To run as an GUI (no console)
ps2exe -inputfile 'YourScript.ps1' -outputfile 'YourScript.exe' -noConsole
To sign the binary, I followed the steps in the following docs:
Signing Command once everything is set up:
& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe" sign /v /debug /fd SHA256 /tr "http://timestamp.acs.microsoft.com" /td SHA256 /dlib "C:\Users\PRIPYAT\Desktop\Sign\Microsoft.Trusted.Signing.Client.1.0.60\bin\x64\Azure.CodeSigning.Dlib.dll" /dmdf "U:\Ken\Embrient\GMS\ESP32C3 Firmware GMS\Holycrapitworks_ST7565_LOX_ESP32C3_copy_20241201\build\esp32.esp32.XIAO_ESP32C3\metadata.json" FlashGMS.exe
The key is to get the following metadata correct and log into azure with the correct credentials
metadata.json
{
"Endpoint": "https://eus.codesigning.azure.net/",
"CodeSigningAccountName": "Embrient",
"CertificateProfileName": "EmbrientPT"
}
The CodeSigningAccountName is the TrustedSigningAccount in the Azure Dashboard
The CertificateProfileName is the relevant entry in your CertificateProfile
compile_powershell.1734986617.txt.gz · Last modified: 2024/12/23 20:43 by kenson


