diff --git a/WindowsPowershell/Profile.ps1 b/WindowsPowershell/Profile.ps1 index 2907178..ccc51f8 100644 --- a/WindowsPowershell/Profile.ps1 +++ b/WindowsPowershell/Profile.ps1 @@ -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 +} \ No newline at end of file