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
  • НаукаНаука

Комментарии • 8

  • @Jacob-tl1ig
    @Jacob-tl1ig 10 месяцев назад

    just used this video thank you got sir worked perfectly

  • @andreampere100
    @andreampere100 2 месяца назад

    Cant this be decrypted to get original code?

  • @jamesa4958
    @jamesa4958 Год назад

    Thank you

  • @BetaPhish
    @BetaPhish Год назад

    $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?

    • @bulatgilfanov9311
      @bulatgilfanov9311 Год назад +1

      Try adding the -RAW parameter to your Get-Content line, should flatten that out to a single string.

    • @BetaPhish
      @BetaPhish Год назад

      @@bulatgilfanov9311 Thanks that seemed to fix it for me

    • @jamesmiscellaneous
      @jamesmiscellaneous 6 месяцев назад

      @@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.