Created
July 19, 2016 02:56
-
-
Save davidroberts63/9f435c557f283114319439228db57cfe to your computer and use it in GitHub Desktop.
Add's MSSQLSERVER as a dependency service to Octopus Deploy for use in test VMs that are started and stopped a lot.
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
$serviceName = "OctopusDeploy" | |
$cmd = "sc.exe config $serviceName depend= " | |
(Get-Service $serviceName | Select -ExpandProperty ServicesDependedOn) | % {$cmd += $_.Name + "/"} | |
$cmd += "MSSQLSERVER" | |
$cmd | |
Invoke-Expression $cmd -Verbose | |
Get-Service $serviceName | Select * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment