After scripting around in Powershell with low restrictions (or for brief periods none) I decided to get my act together and start doing everything Set-ExecutionPolicy AllSigned. After walking through Hanselman's old post, I was unable to even sign my profile.ps1.
A quick test revealed that: Get-ChildItem cert:\CurrentUser\My –codesign always returns null. I opened up certmgr and I can see all of the certificates, but I am uncertain why I can't sign anything local. Running this:
Set-AuthenticodeSignature "C:\users\[MY USER ACCOUNT]\Documents\WindowsPowerShell\profile.ps1" @(Get-ChildItem cert:\CurrentUser\My -codesigning)[0]
Will always return:
Set-AuthenticodeSignature : Cannot bind argument to parameter 'Certificate' because it is null
I am on Windows 7 Ultimate in an administrator account, and I have executed everything in PS or CMD as an admin. I have been pretty much just kind of hacking my way around PowerShell for a while now, but I hope I am not missing something super simple here.