Credits from: https://www.tenforums.com/general-support/107659-how-sign-powershell-profile-w-self-signed-certificate-2.html#post1341612 Attempted and suceeded at 5 March 2021
The following is a powershell-only solution which will not require the installation of extra software/tools/features (at least on Windows 10):
Open up a Powershell window with Admin privileges and run the following to create the self-signed certificate and save it to the PS variable of your choice.
Below, the naming distinction mycert is used. I recommend that or just copy/paste the code.