Instantly share code, notes, and snippets.

Embed
What would you like to do?
$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