I have found that when you want to use PowerShell to sign a script, you need to include the dll in the path. For example:
Set-AuthenticodeSignature -FilePath $target -Certificate $cert -HashAlgorithm "SHA256" -TimestampServer 'http://timestamp.verisign.com/scripts/timstamp.dll'