1. Нам важно Ваше мнение!
    и обсуждайте вместе! Нажимайте "мне нравится" и рекомендуйте друзьям ;)
    Понравилось тема? Напишите в ней свой отзыв.
    Считаете что тема не достаточно полно раскрыта? Расскажите свою точку зрения!
    С Вашей помощью сделаем форум еще лучше!

Memphis : ansible in devops - Eduard Kabrinskiy

Тема в разделе 'Горячие новости для тех кто следит за собой', создана пользователем NashvilleEn, 23 май 2021.

  1. NashvilleEn

    NashvilleEn Member

    Кабринский Эдуард - Azure devops powershell task - Рдуард Кабринский


    <h1>Azure devops powershell task</h1>
    <p>[youtube]</p>
    Azure devops powershell task <a href="http://remmont.com">Top news stories</a> Azure devops powershell task
    <h1>PowerShell parameters in the Azure DevOps pipelines</h1>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps1.PNG" /></p>
    <p>Build and release pipelines in the Azure DevOps can have complex structure. Sometimes there is a need to add PowerShell as one of the steps in these pipelines. Why? For instance to update content of the files from the repository or to use some Azure PowerShell cmdlets to make some updates. In this article I would like to present how to use PowerShell Arguments in the Azure DevOps build and release pipelines.</p>
    <h2>PowerShell Arguments in the Build pipelines</h2>
    <p>Let?s start from the Build pipelines and PowerShell task. First we have to create sample PowerShell script which will be stored in the GIT repository. We will use this script in the Build piepeline step. I put this script in the ?config? folder located in the ?master? branch:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps3.PNG" /></p>
    <p>Below I present the content of this specific script. What we would like to achieve is to retrieve two variables and pass them to the script as parameters. There are two parameters:</p>
    <p>These are declared in the ?Variables? tab in the Build configuration:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps2.PNG" /></p>
    <p>Now let?s analyze build step. For this example lets add only one step with PowerShell script file from the repository above.</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps4.PNG" /></p>
    <p>As you can see in the ?Arguments? field we have to declare which Variables we want to pass to the PowerShell script as parameters:</p>
    <p>Now in the PowerShell script we can get these Variables as params:</p>
    <p>Then we can use them normally in the script:</p>
    <p>Try to run Build and see the result:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps5.PNG" /></p>
    <p>Open step with PowerShell script and see the logs. You should see names declared in the Variables earlier:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps6.PNG" /></p>
    <h2>PowerShell Arguments in the Release pipelines</h2>
    <p>Steps for the Release pipelines are quite the same. First we have to publish PowerShell script from the repository in the Build artifact.</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps7.PNG" /></p>
    <p>Now configure new Release pipeline and connect Build artifact with it:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps8.PNG" /></p>
    <p>Then we have to add Variables that we want to pass:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github..../assets/PowerShellParametersAzureDevOps10.PNG" /></p>
    <p>Now select PowerShell script from the artifacts:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github....7/assets/PowerShellParametersAzureDevOps9.PNG" /></p>
    <p>Now we have to declare ?Arguments? exactly like in the Build pipeline step:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github..../assets/PowerShellParametersAzureDevOps11.PNG" /></p>
    <p>Creat new release and verify logs:</p>
    <p style="clear: both"> <img src="https://daniel-krzyczkowski.github..../assets/PowerShellParametersAzureDevOps12.PNG" /></p>
    <h2>Summary</h2>
    <p>In this article I presented how to inject Variables into PowerShell scripts which are the part of the Build and Release pipelines. Of course this is just a simple example but you can also use this method for more advanced scripts and scenarios. For instance you could get secrets from the Azure Key Vault, load them into Variables Groups and then access them from the PowerShell script.</p>
    <p>Updated:</strong> May 31, 2019</p>
    <h4>Share on</h4>
    <h4>You may also enjoy</h4>
    <h2>Microsoft Azure Developer: Implement API Management </h2>
    <p style="clear: both"><img src="https://daniel-krzyczkowski.github.io/images/devisland/article48/assets/PluralsightCourse5.jpg" /></p>
    <p>This is special article about my Pluralsight course.</p>
    <h2>Microsoft Azure Developer: Instrument Solutions for Monitoring and Logging </h2>
    <p style="clear: both"><img src="https://daniel-krzyczkowski.github.io/images/devisland/article47/assets/PluralsightCourse4.jpg" /></p>
    <p>This is special article about my Pluralsight course.</p>
    <h2>Release notes with Azure Functions and Azure DevOps </h2>
    <p style="clear: both"><img src="https://daniel-krzyczkowski.github.io/images/devisland/article46/assets/ReleaseManagementWiki1.png" /></p>
    <p>This article presents how to generate release notes with Azure Functions in Azure DevOps</p>
    <h2>Manage release flow using pipelines in Azure DevOps </h2>
    <p style="clear: both"><img src="https://daniel-krzyczkowski.github....sets/ReleaseFlowWithAzureDevOpsPipelines1.png" /></p>
    <p>This article presents how to implement release flow using pipelines and environments in Azure DevOps</p>
    <h2>Azure devops powershell task</h2>

    <h3>Azure devops powershell task</h3>
    <p>[youtube]</p>
    Azure devops powershell task <a href="http://remmont.com">Local news</a> Azure devops powershell task
    <h4>Azure devops powershell task</h4>
    In this article I would like to present how to use PowerShell Arguments in the Azure DevOps build and release pipelines.
    <h5>Azure devops powershell task</h5>
    Azure devops powershell task <a href="http://remmont.com">Azure devops powershell task</a> Azure devops powershell task
    SOURCE: <h6>Azure devops powershell task</h6> <a href="https://dev-ops.engineer/">Azure devops powershell task</a> Azure devops powershell task
    #tags#[replace: -,-Azure devops powershell task] Azure devops powershell task#tags#

    Kabrinskiy Eduard
    news today

Поделиться этой страницей