Created
April 2, 2014 12:01
-
-
Save erichexter/9932724 to your computer and use it in GitHub Desktop.
PreDeploy
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
Write-Host "Installing foobar for $Environment" | |
& .\QS.CommandProcessor.exe install -instance:$Environment | Write-Host | |
do | |
{ | |
Write-Host "Starting Command Processor for $Environment" | |
& .\QS.CommandProcessor.exe start -instance:$Environment | Write-Host | |
start-sleep 5 | |
$service = Get-Service "QSCommandProcessor`$$Environment" -ErrorAction SilentlyContinue | |
} while ($service.Status -ne [System.ServiceProcess.ServiceControllerStatus]::Running) |
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
$p = join-path . ".\qs.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() | |
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
$name=foobar | |
$service = Get-Service "$name`$$Environment" -ErrorAction SilentlyContinue | |
if (($service -ne $null) -and ($service.Status -eq [System.ServiceProcess.ServiceControllerStatus]::Running)) | |
{ | |
Write-Host "Stopping Command Processor for $Environment" | |
& .\QS.CommandProcessor.exe stop -instance:$Environment | Write-Host | |
do | |
{ | |
start-sleep 5 | |
$service = Get-Service "$name`$$Environment" -ErrorAction SilentlyContinue | |
} while ($service.Status -ne [System.ServiceProcess.ServiceControllerStatus]::Stopped) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment