Azure DevOps: How can I run powershell on onPrem servers after deployment of all IIS SitesHow to Run Powershell Scripts on Azure VM between Tasks using Release Management (Team Services)Running PowerShell script on VSTS deployment groupAzure deployment from Azure DevOps failing to find zip packageHow to run git push command from Azure DevOps powershell taskAzure DevOps Release Pipeline Priority DeploymentAzure DevOps - Azure Resource Group Deployment: set value of subscription dynamicallyHow to get a Drift Report from Azure DevOps DACPAC deployment?Azure Devops - How to run a powershell script on an App Service post-deploy?Running azure powershell script on web app during release taskHow to delete files in Azure kudu via VSTS after the deployment

How to stretch the corners of this image so that it looks like a perfect rectangle?

Is it "common practice in Fourier transform spectroscopy to multiply the measured interferogram by an apodizing function"? If so, why?

Could the museum Saturn V's be refitted for one more flight?

How badly should I try to prevent a user from XSSing themselves?

Is it possible to create a QR code using text?

Why was Sir Cadogan fired?

Do Iron Man suits sport waste management systems?

What historical events would have to change in order to make 19th century "steampunk" technology possible?

What is the fastest integer factorization to break RSA?

Finding the reason behind the value of the integral.

Placement of More Information/Help Icon button for Radio Buttons

Car headlights in a world without electricity

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

Processor speed limited at 0.4 Ghz

How do I exit BASH while loop using modulus operator?

Is there a hemisphere-neutral way of specifying a season?

What Exploit Are These User Agents Trying to Use?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

What is required to make GPS signals available indoors?

files created then deleted at every second in tmp directory

In Bayesian inference, why are some terms dropped from the posterior predictive?

Is "/bin/[.exe" a legitimate file? [Cygwin, Windows 10]

OP Amp not amplifying audio signal

Did 'Cinema Songs' exist during Hiranyakshipu's time?



Azure DevOps: How can I run powershell on onPrem servers after deployment of all IIS Sites


How to Run Powershell Scripts on Azure VM between Tasks using Release Management (Team Services)Running PowerShell script on VSTS deployment groupAzure deployment from Azure DevOps failing to find zip packageHow to run git push command from Azure DevOps powershell taskAzure DevOps Release Pipeline Priority DeploymentAzure DevOps - Azure Resource Group Deployment: set value of subscription dynamicallyHow to get a Drift Report from Azure DevOps DACPAC deployment?Azure Devops - How to run a powershell script on an App Service post-deploy?Running azure powershell script on web app during release taskHow to delete files in Azure kudu via VSTS after the deployment













0















How can I run a powershell script after all stages have completed deployment? I have currently selected a deployment group job but am not 100% sure if this is what I need. I have included the script as part of the solution that is being deployed so that it will be available on all machines. Based on what I can find in the UI there seem to be 2 tasks that could work.



The first option would be to execute the task "Powershell Script" but it is asking for a path in the drop directory. The problem with this is that the file that I am interested in is in a zip file and there does not seem to be a way to specify a file in the zip file.



The other task I see is "PowerShell on Target Machines" and then it asks for a list of target machines. I am not sure what needs to be entered here as I want to run the powershell script on the current machine in the deploy group. It seems like this task was intended to run powershell scripts from the deployment machine to another remote machine. As a result this option does not seem like it fits my use case.



From looking the answers that I have come across talk about how to do this as part of an Azure site using something called "Kudu" (not relevant) or don't answer my other questions related to these tasks or seem like they are out of date.










share|improve this question


























    0















    How can I run a powershell script after all stages have completed deployment? I have currently selected a deployment group job but am not 100% sure if this is what I need. I have included the script as part of the solution that is being deployed so that it will be available on all machines. Based on what I can find in the UI there seem to be 2 tasks that could work.



    The first option would be to execute the task "Powershell Script" but it is asking for a path in the drop directory. The problem with this is that the file that I am interested in is in a zip file and there does not seem to be a way to specify a file in the zip file.



    The other task I see is "PowerShell on Target Machines" and then it asks for a list of target machines. I am not sure what needs to be entered here as I want to run the powershell script on the current machine in the deploy group. It seems like this task was intended to run powershell scripts from the deployment machine to another remote machine. As a result this option does not seem like it fits my use case.



    From looking the answers that I have come across talk about how to do this as part of an Azure site using something called "Kudu" (not relevant) or don't answer my other questions related to these tasks or seem like they are out of date.










    share|improve this question
























      0












      0








      0








      How can I run a powershell script after all stages have completed deployment? I have currently selected a deployment group job but am not 100% sure if this is what I need. I have included the script as part of the solution that is being deployed so that it will be available on all machines. Based on what I can find in the UI there seem to be 2 tasks that could work.



      The first option would be to execute the task "Powershell Script" but it is asking for a path in the drop directory. The problem with this is that the file that I am interested in is in a zip file and there does not seem to be a way to specify a file in the zip file.



      The other task I see is "PowerShell on Target Machines" and then it asks for a list of target machines. I am not sure what needs to be entered here as I want to run the powershell script on the current machine in the deploy group. It seems like this task was intended to run powershell scripts from the deployment machine to another remote machine. As a result this option does not seem like it fits my use case.



      From looking the answers that I have come across talk about how to do this as part of an Azure site using something called "Kudu" (not relevant) or don't answer my other questions related to these tasks or seem like they are out of date.










      share|improve this question














      How can I run a powershell script after all stages have completed deployment? I have currently selected a deployment group job but am not 100% sure if this is what I need. I have included the script as part of the solution that is being deployed so that it will be available on all machines. Based on what I can find in the UI there seem to be 2 tasks that could work.



      The first option would be to execute the task "Powershell Script" but it is asking for a path in the drop directory. The problem with this is that the file that I am interested in is in a zip file and there does not seem to be a way to specify a file in the zip file.



      The other task I see is "PowerShell on Target Machines" and then it asks for a list of target machines. I am not sure what needs to be entered here as I want to run the powershell script on the current machine in the deploy group. It seems like this task was intended to run powershell scripts from the deployment machine to another remote machine. As a result this option does not seem like it fits my use case.



      From looking the answers that I have come across talk about how to do this as part of an Azure site using something called "Kudu" (not relevant) or don't answer my other questions related to these tasks or seem like they are out of date.







      azure-devops






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 20:43









      Thomas927Thomas927

      4641514




      4641514






















          1 Answer
          1






          active

          oldest

          votes


















          1














          A deployment group job will run on all of the servers specified in that deployment group. Based on what you have indicated, it sounds like that is what you are looking for.



          Since you indicated that the file in question is a zip, you are actually going to need to use 2 separate tasks.



          1. Extract Files - use this to extract the zip file so that you can execute the script

          2. Powershell script - use this to execute the script. You can set the working directory for the script to execute in if necessary (under advanced options). Also remember that you don't have to use the file/folder selector 'helper' as it wont work in your case if the file is inside a zip. This is just used to populate the text box which you can manually do starting with the $(System.DefaultWorkingDirectory) variable and adding the necessary path of the script.





          share|improve this answer























          • I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

            – Thomas927
            Mar 8 at 22:08












          • I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

            – Thomas927
            Mar 8 at 23:11












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070727%2fazure-devops-how-can-i-run-powershell-on-onprem-servers-after-deployment-of-all%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          A deployment group job will run on all of the servers specified in that deployment group. Based on what you have indicated, it sounds like that is what you are looking for.



          Since you indicated that the file in question is a zip, you are actually going to need to use 2 separate tasks.



          1. Extract Files - use this to extract the zip file so that you can execute the script

          2. Powershell script - use this to execute the script. You can set the working directory for the script to execute in if necessary (under advanced options). Also remember that you don't have to use the file/folder selector 'helper' as it wont work in your case if the file is inside a zip. This is just used to populate the text box which you can manually do starting with the $(System.DefaultWorkingDirectory) variable and adding the necessary path of the script.





          share|improve this answer























          • I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

            – Thomas927
            Mar 8 at 22:08












          • I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

            – Thomas927
            Mar 8 at 23:11
















          1














          A deployment group job will run on all of the servers specified in that deployment group. Based on what you have indicated, it sounds like that is what you are looking for.



          Since you indicated that the file in question is a zip, you are actually going to need to use 2 separate tasks.



          1. Extract Files - use this to extract the zip file so that you can execute the script

          2. Powershell script - use this to execute the script. You can set the working directory for the script to execute in if necessary (under advanced options). Also remember that you don't have to use the file/folder selector 'helper' as it wont work in your case if the file is inside a zip. This is just used to populate the text box which you can manually do starting with the $(System.DefaultWorkingDirectory) variable and adding the necessary path of the script.





          share|improve this answer























          • I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

            – Thomas927
            Mar 8 at 22:08












          • I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

            – Thomas927
            Mar 8 at 23:11














          1












          1








          1







          A deployment group job will run on all of the servers specified in that deployment group. Based on what you have indicated, it sounds like that is what you are looking for.



          Since you indicated that the file in question is a zip, you are actually going to need to use 2 separate tasks.



          1. Extract Files - use this to extract the zip file so that you can execute the script

          2. Powershell script - use this to execute the script. You can set the working directory for the script to execute in if necessary (under advanced options). Also remember that you don't have to use the file/folder selector 'helper' as it wont work in your case if the file is inside a zip. This is just used to populate the text box which you can manually do starting with the $(System.DefaultWorkingDirectory) variable and adding the necessary path of the script.





          share|improve this answer













          A deployment group job will run on all of the servers specified in that deployment group. Based on what you have indicated, it sounds like that is what you are looking for.



          Since you indicated that the file in question is a zip, you are actually going to need to use 2 separate tasks.



          1. Extract Files - use this to extract the zip file so that you can execute the script

          2. Powershell script - use this to execute the script. You can set the working directory for the script to execute in if necessary (under advanced options). Also remember that you don't have to use the file/folder selector 'helper' as it wont work in your case if the file is inside a zip. This is just used to populate the text box which you can manually do starting with the $(System.DefaultWorkingDirectory) variable and adding the necessary path of the script.






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 21:10









          DenverDevDenverDev

          33926




          33926












          • I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

            – Thomas927
            Mar 8 at 22:08












          • I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

            – Thomas927
            Mar 8 at 23:11


















          • I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

            – Thomas927
            Mar 8 at 22:08












          • I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

            – Thomas927
            Mar 8 at 23:11

















          I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

          – Thomas927
          Mar 8 at 22:08






          I don't think I was very clear. I just meant the when I use the path selector I end up with a path like: dropenvironmentprojectFiles.zip. I understand that this gets deployed to the server and that the file I am interested in will be here. Based on your second point it seems that I should be able to do something like: $(System.DefaultWorkingDirectory)MyPathToTheFilemyScript.ps1 and it will run this file on the local machine? Assuming that the path is exists on the local machine.

          – Thomas927
          Mar 8 at 22:08














          I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

          – Thomas927
          Mar 8 at 23:11






          I managed to figure this out. Just for the sake of trying something I set up a copy file task. I set the target path like so: $(build.artifactstagingdirectory)/Deployment. This will put the contents of this folder in the artifacts directory. Now you will be able to use the path selector in the powershell task to select the files that you need to run.

          – Thomas927
          Mar 8 at 23:11




















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55070727%2fazure-devops-how-can-i-run-powershell-on-onprem-servers-after-deployment-of-all%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

          2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

          Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme