Skip to content

Instantly share code, notes, and snippets.

@mikerodionov
Created May 18, 2018 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikerodionov/443959bd92f569fdc21c1c4cd0f32d5d to your computer and use it in GitHub Desktop.
Save mikerodionov/443959bd92f569fdc21c1c4cd0f32d5d to your computer and use it in GitHub Desktop.
$newConnection = "Data Source=DLX;Initial Catalog=K2;Integrated Security=True"
$installKey = Get-ItemProperty "HKLM:\SOFTWARE\SourceCode\blackpearl\blackpearl Core"
$configPath = $installKey.InstallDir + "Setup\Configuration.config"
$xml = New-Object XML
$xml.Load($configPath)
$connectionNode = $xml.configuration.configurationdatabase.add | Where-Object { $_.key -eq 'connectionString' }
$connectionNode.value = $newConnection
$xml.Save($configPath)
$setupExe = $installKey.InstallDir + "Setup\Setup.exe"
Start-Process $setupExe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment