Created
September 16, 2019 05:40
-
-
Save MarioBinder/83e362b759a2437dd7ee99cbf7e32993 to your computer and use it in GitHub Desktop.
Windows Service / Job Deploy #teamcity
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 = "%INT_Jobserver_Name%" | |
| $username = "%INT_Jobserver_Username%" | |
| $password = "%INT_Jobserver_Password%" | ConvertTo-SecureString -AsPlainText -Force | |
| $creds = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password | |
| $session = New-PSSession -ComputerName $server -Credential $creds | |
| Enter-PSSession $session | |
| Invoke-Command {Stop-Service "Softcrafts.Service.Name"} -Session $session | |
| Start-Sleep -s 30 | |
| Copy-Item -Path "Softcrafts.Service.Name\bin\%BuildConfiguration%\**\" -Destination "%INT_Jobserver_Softcrafts_Service_Rootpath%Softcrafts.Service.Name" –Recurse -ToSession $session | |
| Start-Sleep -s 30 | |
| Invoke-Command {Start-Service "Softcrafts.Service.Name"} -Session $session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment