I'm about average as a PowerShell person. But all the PowerShell I've authored as for me, specifically. I have no experience at authoring or uses PowerShell scripts to run on a Windows server, to handle tasks. Until now.
Here's my scenario. I am on a team of GitHub Administrators at work. Three years ago, I configured a Windows Server with GitHub's Self-Hosted Runner. It's been running fine ever since. When I provisioned the server, I asked for a lot of resources and was granted that request. Three years later and the server still has a lot of disk space available, etc. However, I have learned that GitHub Self-Hosted Runners do not mimic exactly how GitHub runners. Specifically, GitHub Runners, when they're done, will dispose of the files and folders they used, in the CI and CD portions of a GitHub Action. But GitHub Self-Hosted Runners do not dispose of those files and folders. Currently, our GitHub Self-Hosted Runner server still has a lot of disk space, so if nothing drastic changes it should be fine for another few years. But if the number of repos that use the Self-Hosted Runner increase, then we could have a problem sooner than current projections account for.
I have a PowerShell script for purging old copies of the files and folders that the GitHub Self-Hosted Runner uses. I tried running it on that server, but it failed telling me that I cannot run it. Long story short, I now know that I've got to digitally sign that PowerShell script. Doing more research, it appears that either we could use a CA or I could create a self-signed certificate, using what I've found on this web site PowerShell Signing Scripts: Code Sign your .ps1 Files. However, in that page it uses code snippets like this:
$certs = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert
My question deals with the CurrentUser. That would be OK if it were me, but what happens if and when I leave? Is there a way of making the scripts on that page use something other than CurrentUser?