Skip to content

Instantly share code, notes, and snippets.

@erichexter
Created September 16, 2013 18:05
Show Gist options
  • Save erichexter/6584265 to your computer and use it in GitHub Desktop.
Save erichexter/6584265 to your computer and use it in GitHub Desktop.
Encrypt Configuration Settings from octopus deploy postdeploy.ps1
$p = join-path . ".\CommandProcessor.exe" -Resolve
$c =[System.Configuration.ConfigurationManager]::OpenExeConfiguration($p)
$s=$c.GetSection("connectionStrings")
$s.SectionInformation.ProtectSection($null)
$s=$c.GetSection("appSettings")
$s.SectionInformation.ProtectSection($null)
$c.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment