Using Azure Pipelines with PowerShell to build your UWP Application, using PowerShell to download and install Microsoft Store Services & Microsoft Advertising [UWP][PowerShell]
Back story
One of my application has was using the SDK Microsoft Store Services & Microsoft Advertising but these where not loaded as nuget packages which means that when I was building my application on Azure Pipelines I was getting an error saying that Azure Pipelines could not build my application.
I was getting the following error in Azure:

The issue was that I had installed these two SDKs Microsoft Store Services & Microsoft Advertising on my development machine this means that every time I would build my application (localy) it would pull these two SDKs from my machine.
The First solution I found was to download the SDK using PowerShell.
Here are the steps:
- this first go in Pipelines
- click on Builds
- then click on Edit
- next under the Tab Task
- click on the Plus search for PowerShell
- lastly add the task just before your the build task of your application.
Here are the steps in picture:

Now we need to select our PowerShell file that needs to be executed:

You can also do it in YAML :
steps:
- task: PowerShell@2
displayName: 'PowerShell Script'
inputs:
targetType: filePath
filePath: ./AzurePipelinesPowershell.ps1
More information on using PowerShell in Azure Pipelines:
My PowerShell File
Now we will look at the PowerShell file that will be used to download and install the SDK:
Write-Host "Installing Microsoft Store Services SDK..."
$msiPath = "$($env:USERPROFILE)\AdMediator.msi"
(New-Object Net.WebClient).DownloadFile('https://admediator.gallerycdn.vsassets.io/extensions/admediator/microsoftstoreservicessdk/10.0.5/1550117536112/MicrosoftStoreServicesSDK.msi', $msiPath)
cmd /c start /wait msiexec /i $msiPath /quiet
Write-Host "Installed" -ForegroundColor greenWrite-Host "Installing Microsoft Advertising SDK..."
$msiPath = "$($env:USERPROFILE)\AdMediator.msi"
(New-Object Net.WebClient).DownloadFile('https://admediator.gallerycdn.vsassets.io/extensions/admediator/microsoftadvertisingsdk/10.1.00/1548989510766/MicrosoftAdvertisingSDK.msi', $msiPath)
cmd /c start /wait msiexec /i $msiPath /quiet
Write-Host "Installed" -ForegroundColor green
This can be used to download and install any other type of SDK all you need to have the the download URL of the SDK you wish to install.
Now when you queue the build you will have the SDK downloaded and installed during your build as follows:

Nuget Packages
The other solution would be to use the nuget packages for these two SDKs:
For Microsoft Store Services SDK:
For Microsoft Advertising SDK:
Happy coding!