Created
January 3, 2019 15:06
-
-
Save JohnyWS/6d0df355bfa63b05e5405c1c3939c69b to your computer and use it in GitHub Desktop.
Helper file to spin up various required services
This file contains 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
# Helper method | |
function StartService($ServiceName) { | |
$arrService = Get-Service -Name $ServiceName | |
while ($arrService.Status -ne 'Running') | |
{ | |
Start-Service $ServiceName | |
write-host $arrService.status | |
write-host 'Service starting' | |
Start-Sleep -seconds 5 | |
$arrService.Refresh() | |
if ($arrService.Status -eq 'Running') | |
{ | |
Write-Host "Service '$ServiceName' is now Running" | |
} | |
} | |
} | |
# Services to ensure is started | |
StartService('MSDTC') | |
pause |
Author
JohnyWS
commented
Dec 2, 2019
via email
Hi there
That depends on a few factors. Normally you can just run a script by right
clicking and selecting "Run with Powershell". If that does not work for
you, do you have details from an errorprompt you can share?
Best regards,
Johny Woller Skovdal <http://Johny.WollerSkovdal.dk/en>
Den man. 2. dec. 2019 kl. 10.30 skrev ESWAR2510 <notifications@github.com>:
… Could you please let me know how to run the script?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/6d0df355bfa63b05e5405c1c3939c69b?email_source=notifications&email_token=ABB265APL3ZZUTOY22C6GRLQWTIS7A5CNFSM4JTSZZ52YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF5CZY#gistcomment-3098012>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABB265AWHUQTV3ZK7CS2UY3QWTIS7ANCNFSM4JTSZZ5Q>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment