Created
August 13, 2020 23:29
-
-
Save scbedd/d27c72db4e642ebf6140f086b7469edb to your computer and use it in GitHub Desktop.
Of JS Packages, which ones are unpublished to docs.ms.com?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assumes that NPM is installed and available | |
$indexUrl = "https://raw.githubusercontent.com/Azure/azure-sdk/master/_data/releases/latest/js-packages.csv" | |
$interrogativeUrl = "https://docs.microsoft.com/en-us/javascript/api" | |
$content = (Invoke-RestMethod -Method GET -Uri $indexUrl) | |
# assumes that the location is common | |
$results = $content.Split("`n") | ? { $_ } | |
$results = $results[1..($results.Length-1)] | |
$indexPackages = @{} | |
foreach ($result in $results) { | |
$packageId = $result.Split(",")[0].Trim("`"") | |
$publishStatus = $false | |
try { | |
Write-Host "$interrogativeUrl/$packageId/" | |
$result = Invoke-RestMethod -Method GET -Uri "$interrogativeUrl/$packageId/" | |
$publishStatus = $true | |
} | |
catch { | |
} | |
$indexPackages[$packageId] = $publishStatus | |
} | |
$indexPackages | Format-Table -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment