Created
December 29, 2020 14:06
-
-
Save johnmmoss/13f9da3d8e1f0bdea3c999c8db460a0d to your computer and use it in GitHub Desktop.
Script hack to update web.config before build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$server = "127.0.0.1" | |
$database = "TomatoFarm123" | |
$username ="use12356" | |
$password = "pAssWord!" | |
$connectionString = "Server=$server;Database=$database;User Id=$username;Password=$password;" | |
$webConfig = "C:\Code\tomatofarm\Api\Api\Web.Config" | |
$xml = New-Object xml | |
$xml.PreserveWhitespace = $true | |
$xml.Load($webConfig) | |
$xml.configuration.connectionStrings.add.connectionString = $connectionString | |
$xml.Save($webConfig) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment