The procedure below will give you a button in the Add-ons menu that allows you to sign your scripts in PowerShell ISE. You will need to download the PowerShell function that I have signed from https://velocity.ncsu.edu/dl/uFjkxzs/137992. Remember the path you saved file to, you will need it for the line you add to $Profile. Signisescript.ps1 is a function that Jeffrey Hicks wrote. It saves the PowerShell script if it needs to be. It then checks to see if the script is encoded in BigEndian, closing the file and saving it as Unicode if it is. Then the script is signed.
- First step is to create a PowerShell ISE profile if you don’t have one. If you have profile already skip the second bullet point.
- Open PowerShell ISE.
- In command window type: new-item $profile -type file
- In command window type: notepad.exe $profile
- Add the following lines to the file:
- . c:\path to file\signisescript.ps1 ## there is a space after the . ##
- $psISE.CurrentPowerShellTab.AddOnsMenu.submenus.Add(“Sign Script”,{Sign-ISEScript},$null) | Out-Null
- Now you will need to sign your $profile, otherwise the AD policy won’t allow the profile to load.
- Close PowerShell ISE
- Open PowerShell ISE and test.