Function to query catalog

Add a function to query the catalog by product ID.
This commit is contained in:
John Doty 2015-03-31 07:29:19 -07:00
parent 08b1c963d8
commit 6f50cb3c37

View file

@ -314,3 +314,12 @@ function Start-IIS(
Start-Process -Wait -NoNewWindow -FilePath "${env:ProgramFiles}\IIS Express\iisexpress.exe" -ArgumentList $iis_args
}
function Get-ProductById(
[string]$ProductId,
[string]$Market='US',
[string]$Language='en-US')
{
$x = Invoke-WebRequest "https://displaycatalog.md.mp.microsoft.com/products/$($ProductId)?fieldsTemplate=Full&market=$($Market)&language=$($Language)" -Headers @{ 'MS-Contract-Version'=5; }
return convertfrom-json $x.Content
}