Automating deploy for services

Welcome Forums General PowerShell Q&A Automating deploy for services

Viewing 1 reply thread
  • Author
    Posts
    • #253880
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      Hi there,

      I’m creating a powershell script to automate deploying windows service applications. So, what we usually do is stop the service through services.msc, create a backup version inside a folder named by current date, copy files to there, replace the service files with the new version and, finally, we start the service again.

      I created the script below step-by-step and it seems fine, BUT, I tested running from a different location than original one and then, I got unexpected results… It changed the local files from where I was executing.

      My plan is to use this script for deploying service at least from homologation environment and maybe production as well (do you guys consider any risk using as it is?)

      Could anyone give me a feedback about source code it?

      • This topic was modified 4 months, 3 weeks ago by kvprasoon. Reason: Code Formatting
    • #253946
      Senior Moderator
      Topics: 9
      Replies: 1450
      Points: 5,434
      Helping Hand
      Rank: Community MVP

      Get-ChildItem has a parameter -Path, if not specified, it will consider the default value which is the current location. So you can specify the required path using -Path parameter.

Viewing 1 reply thread
  • The topic ‘Automating deploy for services’ is closed to new replies.