diff --git a/.azure/pipelines/azure-pipelines-build.yml b/.azure/pipelines/azure-pipelines-build.yml index fd803c19..70dbac7b 100644 --- a/.azure/pipelines/azure-pipelines-build.yml +++ b/.azure/pipelines/azure-pipelines-build.yml @@ -31,23 +31,9 @@ stages: CleanPublishFolder: true PublishFolder: ${{parameters.PublishFolder}} - - task: PowerShell@2 - displayName: Create AgentCapabilities Environment Variables - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - inputs: - targetType: filePath - filePath: './.azure/scripts/CreateAgentCapabilitiesEnvironmentVariables.ps1' - arguments: "-CollectionUri '$(System.CollectionUri)' -AgentId '$(Agent.Id)' -AgentName '$(Agent.Name)' -AccessToken '$(System.AccessToken)' -DebugMode $(System.Debug)" - pwsh: true + - template: create-agent-capabilities-environment-variables.yml@self - - task: PowerShell@2 - displayName: Output Environment Variables - condition: contains(variables['system.debug'], 'true') - inputs: - targetType: inline - script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String' - pwsh: true + - template: output-environment-variables.yml@self - task: NuGetToolInstaller@1 displayName: Install NuGet 4.4.1 diff --git a/.azure/pipelines/azure-pipelines.yml b/.azure/pipelines/azure-pipelines.yml index fd88b36c..28de510a 100644 --- a/.azure/pipelines/azure-pipelines.yml +++ b/.azure/pipelines/azure-pipelines.yml @@ -62,13 +62,7 @@ stages: CleanPublishFolder: false PublishFolder: $(PublishFolder) - - task: PowerShell@2 - displayName: Output Environment Variables - condition: contains(variables['system.debug'], 'true') - inputs: - targetType: inline - script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String' - pwsh: true + - template: output-environment-variables.yml@self - checkout: MasterRepo @@ -104,13 +98,7 @@ stages: CleanPublishFolder: false PublishFolder: $(PublishFolder) - - task: PowerShell@2 - displayName: Output Environment Variables - condition: contains(variables['system.debug'], 'true') - inputs: - targetType: inline - script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String' - pwsh: true + - template: output-environment-variables.yml@self - checkout: MasterRepo diff --git a/.azure/pipelines/create-agent-capabilities-environment-variables.yml b/.azure/pipelines/create-agent-capabilities-environment-variables.yml new file mode 100644 index 00000000..61cde186 --- /dev/null +++ b/.azure/pipelines/create-agent-capabilities-environment-variables.yml @@ -0,0 +1,10 @@ +steps: +- task: PowerShell@2 + displayName: Create AgentCapabilities Environment Variables + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + inputs: + targetType: filePath + filePath: './.azure/scripts/CreateAgentCapabilitiesEnvironmentVariables.ps1' + arguments: "-CollectionUri '$(System.CollectionUri)' -AgentId '$(Agent.Id)' -AgentName '$(Agent.Name)' -AccessToken '$(System.AccessToken)' -DebugMode $(System.Debug)" + pwsh: true diff --git a/.azure/pipelines/output-environment-variables.yml b/.azure/pipelines/output-environment-variables.yml new file mode 100644 index 00000000..0834e1ff --- /dev/null +++ b/.azure/pipelines/output-environment-variables.yml @@ -0,0 +1,8 @@ +steps: +- task: PowerShell@2 + displayName: Output Environment Variables + condition: contains(variables['system.debug'], 'true') + inputs: + targetType: inline + script: '(gci env:*).GetEnumerator() | Sort-Object Name | Out-String' + pwsh: true