Skip to content

Instantly share code, notes, and snippets.

@scbedd
Created August 13, 2020 23:29
Show Gist options
  • Save scbedd/d27c72db4e642ebf6140f086b7469edb to your computer and use it in GitHub Desktop.
Save scbedd/d27c72db4e642ebf6140f086b7469edb to your computer and use it in GitHub Desktop.
Of JS Packages, which ones are unpublished to docs.ms.com?
# 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