Hi Luc,
I am running powershell scripts from following environment.
and
i want to do two things to those scripts.
1:password protect the script
2:digitally sign script using self signed certificates .
can you please suggest some easy ways to do above two considering above environment.
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 with
Set-AuthenticodeSignature -FilePath C:\Scripts\myscript.ps1 -Certificate $cert
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i dont find
Get-ChildItem -Path cert: -CodeSigningCert
That probably means that you have no codesigning certificate installed.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
do i need to work on windows 2012 server then .if you can suggest some alternate solutions for this.
That has nothing to do with the OS version afaik.
Did you import a codesigning certificate on the platform?
Have a read of the post Signing PowerShell Scripts.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thnaks iam checking this.