PowerShell Pro Tools
Ironman SoftwareGitHub
  • About
  • System Requirements
  • PowerShell Tools Documentation
    • Visual Studio
      • Analysis
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Format Document
      • Go to Definition
      • Packaging in Visual Studio
      • PowerShell 7 Support
      • PowerShell Interactive Window
      • Project System
        • Advanced
        • Debug
        • Build Events
      • Settings
        • General
        • .editorconfig
        • Analysis
        • Diagnostics
      • Tool Windows
      • Refactoring
      • Unit Test Adapter
      • User Interface Design
        • Windows Forms
  • PowerShell Pro Tools Documentation
    • Visual Studio Code
      • Automating Visual Studio Code
      • Code Conversion
      • Debugging
        • Run in New Terminal
        • One-Click Attach
      • Decompiler
      • Diagnostics
      • Enhanced Hover
      • Generating a UI from a function
      • Generate a Tool from a Function
      • Packaging in Visual Studio Code
      • Pin Session
      • PowerShell Explorer
      • Profiler
      • Sign On Save
      • RapidSense
      • Refactoring
      • Rename Symbols
      • Quick Scripts
      • Windows Forms Designer
    • Installers
    • Packaging
      • Package.psd1
      • PowerShell Packager
      • Package Hosts
      • Package as Service
      • Packaging on Linux
      • Packaging on Mac OS X
      • Continuous Integration
      • Anti-Virus
    • PowerShell Module
      • Global Hotkeys
      • Show-PSEditor
      • Show-PSScriptPad
      • Show-TUIDesigner
      • ConvertTo-CSharp
      • ConvertTo-PowerShell
      • Merge-Script
      • Install-PoshProToolsLicense
      • about_MergeScriptConfig
      • Show-WinFormDesigner
    • PowerShell Protect
      • Getting Started
      • Installation
      • Actions
      • Rules
      • Configuration
    • PSCommander
    • PSScriptPad
    • Installation and Licensing
      • Visual Studio Offline Installation
  • Changelog
    • PowerShell Tools for Visual Studio
    • PowerShell Pro Tools for Visual Studio Code
    • PowerShell Packager
    • PSScriptPad
    • PowerShell Pro Tools Module
Powered by GitBook
On this page
  • MSBuild and Azure DevOps
  • Add Assets to Repository
  • Update PSSProj File
  • Setup the Azure DevOps Pipeline
  • Run the Build
  1. PowerShell Pro Tools Documentation
  2. Packaging

Continuous Integration

Setup packaging within a continuous integration environment.

PreviousPackaging on Mac OS XNextAnti-Virus

Last updated 9 months ago

MSBuild and Azure DevOps

You will need to include the MSBuild targets and assemblies in your repository in order to packaging during the build process.

Add Assets to Repository

The MSBuild assets are stored in the Visual Studio MSBuild directory when the extension is installed.

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\PowerShell Tools for Visual Studio

Your path to this folder may different based on your version and edition of Visual Studio. can be used to determine this file location.

Place the files in a directory that you can link to during the build process. As an example, you can place them at the root of the repo.

Update PSSProj File

Next, update the PSSProj file to import the targets file for PowerShell Tools for Visual Studio. Include a condition so the build still works locally. This should be placed at the bottom of the file after the existing import. If you placed the assets in a different location, you will need to update your path. The below example uses the SolutionDir MSBuild property to locate the directory of the solution file.

<!-- Existing:  <Import Project="$(MSBuildExtensionsPath)\PowerShell Tools for Visual Studio\PowerShellTools.targets" Condition="Exists('$(MSBuildExtensionsPath)\PowerShell Tools for Visual Studio\PowerShellTools.targets')" /> -->
<Import Project="$(SolutionDir)\PowerShell Tools for Visual Studio\PowerShellTools.targets" Condition="Exists('$(SolutionDir)\PowerShell Tools for Visual Studio\PowerShellTools.targets')" />

Setup the Azure DevOps Pipeline

Finally, setup the Azure DevOps pipeline to run the VSBuild target against the Solution Directory. This example uploads the compiled artifact after the build so it can be downloaded from the Azure DevOps portal.

trigger:
- main

pool:
  vmImage: windows-latest

steps:
- task: VSBuild@1
  inputs:
    solution: '**\*.sln'
- publish: $(System.DefaultWorkingDirectory)/bin/Debug
  artifact: App

Run the Build

Once the pipeline is complete, it should run automatically. If it hasn't you can run it manually and view the job output. The built binaries will be included under the related section.

VSWhere
PowerShell Tools for VS Folder