diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f29f3aa6c0..853f57d038 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -69,6 +69,19 @@ jobs: - task: NuGetToolInstaller@1 displayName: Install Nuget + - powershell: | + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force + Install-Module Microsoft.WinGet.Client -Repository PSGallery -Force + Repair-WingetPackageManager -AllUsers + Install-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget + displayName: Install Sysinternals PsTools Using Winget + condition: succeededOrFailed() + + - powershell: | + Uninstall-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget + displayName: Clean up Sysinternals PsTools + condition: succeededOrFailed() + # Restores all projects, including native (vcxproj) projects - task: NuGetCommand@2 displayName: Restore Solution @@ -347,22 +360,22 @@ jobs: inputs: packageFeedSelector: 'nugetOrg' - - pwsh: | - Add-AppxPackage "${env:ProgramFiles(x86)}\Microsoft SDKs\Windows Kits\10\ExtensionSDKs\Microsoft.VCLibs.Desktop\14.0\Appx\Retail\x64\Microsoft.VCLibs.x64.14.00.Desktop.appx" + - powershell: | + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force Install-Module Microsoft.WinGet.Client -Repository PSGallery -Force Repair-WingetPackageManager -AllUsers Install-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget displayName: Install Sysinternals PsTools Using Winget condition: succeededOrFailed() - - pwsh: | + - 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 workingDirectory: '$(buildOutDir)\AppInstallerCLITests' condition: succeededOrFailed() - - pwsh: | + - powershell: | Uninstall-WinGetPackage -Id Microsoft.Sysinternals.PsTools -Source winget displayName: Clean up Sysinternals PsTools condition: succeededOrFailed()