How To Encrypt Code in PowerShell Scripts
HTML-код
- Опубликовано: 8 сен 2024
- PowerShell scripts can contain sensitive information you wouldn't want to fall into the wrong hands. This video tutorial by Brien Posey explains how to encrypt individual lines of code within PowerShell scripts.
Brien Posey is a bestselling technology author, speaker, and 21x Microsoft MVP. In addition to his ongoing work in IT, Posey has trained as a commercial astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space.
For daily news, analysis, opinions and how-to’s about the IT industry, visit us at ITPro Today: www.itprotoday...
Music by AudioCoffee from Pixabay - Наука
just used this video thank you got sir worked perfectly
Cant this be decrypted to get original code?
Thank you
$CodeSecureString = ConvertTo-SecureString $Code -AsPlainText -Force
ConvertTo-SecureString: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'String'. Specified method is not supported.
I get the above error. Any info on this?
Try adding the -RAW parameter to your Get-Content line, should flatten that out to a single string.
@@bulatgilfanov9311 Thanks that seemed to fix it for me
@@bulatgilfanov9311 Thanks for -raw. You ever try to accomplish this same task using a encryption key? Trying to get an encrypted script to decrypt and run on other devices, not just the one it was encrypted on.