Skip to content

Instantly share code, notes, and snippets.

@heaths
Created July 17, 2023 21:17
Show Gist options
  • Save heaths/587f0ed4f928fb5bd539c4680a793013 to your computer and use it in GitHub Desktop.
Save heaths/587f0ed4f928fb5bd539c4680a793013 to your computer and use it in GitHub Desktop.
Gets a list of deprecated Azure SDK for .NET packages
[CmdletBinding()]
param(
[ValidateNotNullOrEmpty()]
[Parameter()]
[datetime] $Date = [DateTime]::Now
)
$packages = Invoke-WebRequest 'https://raw.githubusercontent.com/Azure/azure-sdk/main/_data/releases/latest/dotnet-packages.csv' | ConvertFrom-Csv
$deprecated = $packages | Where-Object { $_.Support -eq 'deprecated' -and [datetime] $_.EOLDate -le $Date }
Write-Verbose "Found $($deprecated.Length) deprecated packages"
$services = @{}
$discovered = 0
foreach ($sd in Get-ChildItem 'sdk') {
foreach ($p in Get-ChildItem $sd | Where-Object Name -in $deprecated.Package) {
$discovered++
$services[$sd.Name] += @($p.Name)
}
}
Write-Verbose "Found $discovered deprecated packages in $($services.Count) service directories"
$services.GetEnumerator() # Unroll the hashtable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment