diff --git a/.vsts-ci/communityReleaseBuild.yml b/.vsts-ci/communityReleaseBuild.yml index 6680a192c..c8490a58b 100644 --- a/.vsts-ci/communityReleaseBuild.yml +++ b/.vsts-ci/communityReleaseBuild.yml @@ -1,6 +1,10 @@ resources: - repo: self clean: true + +variables: + POWERSHELL_TELEMETRY_OPTOUT: 1 + jobs: - job: communityRelease pool: diff --git a/.vsts-ci/releasebuild.yml b/.vsts-ci/releasebuild.yml index 9bd0f9ff0..9795c4faa 100644 --- a/.vsts-ci/releasebuild.yml +++ b/.vsts-ci/releasebuild.yml @@ -3,8 +3,11 @@ name: s_$(stableReleaseTag)_p_$(previewReleaseTag)$(Rev:_rr) resources: - repo: self clean: true -jobs: +variables: + POWERSHELL_TELEMETRY_OPTOUT: 1 + +jobs: - template: releasePhase.yml parameters: channel: STABLE diff --git a/tests/containerTestCommon.psm1 b/tests/containerTestCommon.psm1 index 7c4d1c858..494492403 100644 --- a/tests/containerTestCommon.psm1 +++ b/tests/containerTestCommon.psm1 @@ -43,16 +43,26 @@ function Invoke-Docker $cli = @('docker') } + $actualParams = @() + + if($command -eq 'run') + { + $actualParams += '--env' + $actualParams += 'POWERSHELL_TELEMETRY_OPTOUT=1' + } + + $actualParams += $Params + # Log how we are running Docker for troubleshooting issues - Write-Verbose "Running $cli $cliCommand $command $params" -Verbose + Write-Verbose "Running $cli $cliCommand $command $actualParams" -Verbose if($SuppressHostOutput.IsPresent) { - $result = &$cli $cliCommand $command $params 2>&1 + $result = &$cli $cliCommand $command $actualParams 2>&1 } else { - &$cli $cliCommand $command $params 2>&1 | Tee-Object -Variable result -ErrorAction SilentlyContinue | Out-String -Stream -ErrorAction SilentlyContinue | Write-Host -ErrorAction SilentlyContinue + &$cli $cliCommand $command $actualParams 2>&1 | Tee-Object -Variable result -ErrorAction SilentlyContinue | Out-String -Stream -ErrorAction SilentlyContinue | Write-Host -ErrorAction SilentlyContinue } $dockerExitCode = $LASTEXITCODE diff --git a/vsts-ci.yml b/vsts-ci.yml index a641c7f1c..d8aead63c 100644 --- a/vsts-ci.yml +++ b/vsts-ci.yml @@ -1,8 +1,12 @@ name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr) + resources: - repo: self clean: true +variables: + POWERSHELL_TELEMETRY_OPTOUT: 1 + jobs: - job: Set_Build_Name