diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1a0db7838..359568312a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -348,18 +348,30 @@ jobs: inputs: packageFeedSelector: 'nugetOrg' - - task: DownloadSecureFile@1 - name: PsExec - displayName: 'Download PsExec.exe' - inputs: - secureFile: 'PsExec.exe' + # TODO: Repair-WinGetPackageManager will fail because it tries to install x64 for an x86 build machine. + # Remove manual installation of VCLibs (x64) once this is fixed. + - powershell: | + if ("$(buildPlatform)" -eq "x86") { + iwr https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.appx + Add-AppxPackage Microsoft.VCLibs.x64.appx + } + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force + Install-Module Microsoft.WinGet.Client -Repository PSGallery -Force + Repair-WingetPackageManager -AllUsers -Latest + Install-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget + displayName: Install Sysinternals PsTools Using Winget + condition: succeededOrFailed() - - task: CmdLine@2 + - powershell: | + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") + PsExec -accepteula -s -i $(buildOutDir)\AppInstallerCLITests\AppInstallerCLITests.exe -logto $(artifactsDir)\AICLI-Unpackaged-System.log -s -r junit -o $(artifactsDir)\TEST-AppInstallerCLI-Unpackaged-System.xml displayName: Run Unit Tests Unpackaged Under System Context - inputs: - script: | - $(PsExec.secureFilePath) -accepteula -s -i $(buildOutDir)\AppInstallerCLITests\AppInstallerCLITests.exe -logto $(artifactsDir)\AICLI-Unpackaged-System.log -s -r junit -o $(artifactsDir)\TEST-AppInstallerCLI-Unpackaged-System.xml - workingDirectory: '$(buildOutDir)\AppInstallerCLITests' + workingDirectory: '$(buildOutDir)\AppInstallerCLITests' + condition: succeededOrFailed() + + - powershell: | + Uninstall-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget + displayName: Clean up Sysinternals PsTools condition: succeededOrFailed() - task: PowerShell@2