1. I'm not aware of a method to password protect a .ps1 script.
You could look at ACLs to protect your file from being read, but that would mean the user can't execute the script either.
He needs to be able to read the script to run it.
2. To sign a .ps1 script, you will need a codesigning certificate.
You can check if there is one withGet-ChildItem -Path cert: -CodeSigningCertWhen you have a signing certificate, you can do.The Set-AuthenticodeSignature cmdlet was introduced in PS v3, so normally it should be available to you on that platform.$cert = Get-ChildItem -CodeSigningCert -Path Cert:\LocalMachine\My\
Set-AuthenticodeSignature -FilePath C:\Scripts\myscript.ps1 -Certificate $cert
i dont find
Get-ChildItem -Path cert: -CodeSigningCert
That probably means that you have no codesigning certificate installed.
do i need to work on windows 2012 server then .if you can suggest some alternate solutions for this.
thnaks iam checking this.