Automating deploy for services

Welcome Forums General PowerShell Q&A Automating deploy for services

Viewing 1 reply thread
  • Author
    • #253880
      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 3 weeks, 3 days ago by kvprasoon. Reason: Code Formatting
    • #253946
      Senior Moderator
      Topics: 9
      Replies: 1311
      Points: 4,794
      Helping Hand
      Rank: Community Hero

      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
  • You must be logged in to reply to this topic.