July 2018
Beginner
552 pages
13h 18m
English
Proving that changes were made to your scripts is very easy, if you can already use digital signatures. With the Get-AuthenticodeSignature cmdlet, you will see either a valid script or a hash mismatch, meaning a change to your script:
# signed scripts$codeSigningCert = Get-ChildItem Cert:\CurrentUser\my -CodeSigningCertNew-Item -ItemType File -Path .\ValidScript.ps1 -Value 'Get-Process -Id $Pid'Set-AuthenticodeSignature -FilePath .\ValidScript.ps1 -Certificate $codeSigningCert -IncludeChain all(Get-Content -Path .\ValidScript.ps1) -replace 'Get-Process', 'Stop-Process' | Set-Content .\ValidScript.ps1Get-AuthenticodeSignature -FilePath .\ValidScript.ps1
Another way of proving that changes were made is to create ...
Read now
Unlock full access