src/_Get-CciBlobModuleIndex.ps1
|
function _Get-CciBlobModuleIndex { <# .SYNOPSIS Reads <blobPrefix>/index.json from the tenant distribution store. .DESCRIPTION The index maps published module names to their latest version: { "modules": { "cciit.wincustpayload": { "latest": "0.1.1.2" } } } Returns $null when absent or unreadable - callers treat that as "the store has nothing to offer". #> [CmdletBinding()] param( [Parameter(Mandatory)]$Feed, [Parameter(Mandatory)]$Context ) $tmp = Join-Path ([IO.Path]::GetTempPath()) "cciget-index-$([guid]::NewGuid().ToString('n')).json" try { $null = _Invoke-CciBlobRequest -Context $Context -Operation Download ` -Container $Feed.blobContainer -Blob "$($Feed.blobPrefix)/index.json" -Path $tmp return (Get-Content $tmp -Raw | ConvertFrom-Json) } catch { Write-Verbose "cciget: no module index in the distribution store: $_" return $null } finally { Remove-Item $tmp -Force -ErrorAction SilentlyContinue } } |