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
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
add a comment |
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
add a comment |
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
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
azure-devops
asked Mar 8 at 20:43
Thomas927Thomas927
4641514
4641514
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
- Extract Files - use this to extract the zip file so that you can execute the script
- 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.
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
- Extract Files - use this to extract the zip file so that you can execute the script
- 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.
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
add a comment |
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.
- Extract Files - use this to extract the zip file so that you can execute the script
- 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.
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
add a comment |
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.
- Extract Files - use this to extract the zip file so that you can execute the script
- 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.
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.
- Extract Files - use this to extract the zip file so that you can execute the script
- 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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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