src/Find-CciModule.ps1
|
function Find-CciModule { <# .SYNOPSIS Search registered CCI feeds for modules. .PARAMETER Name Module name or wildcard. Defaults to '*'. .PARAMETER Tenant Optional. Restrict search to a single tenant feed. .EXAMPLE Find-CciModule Cci.Citrix .EXAMPLE Find-CciModule -Tenant ccidev * #> [CmdletBinding()] param( [Parameter(Position = 0)] [string]$Name = '*', [string]$Tenant ) $feeds = _Resolve-CciGetFeed -Tenant $Tenant foreach ($feed in $feeds) { $repoName = _Get-CciGetRepositoryName -FeedName $feed.name if (-not (Get-PSResourceRepository -Name $repoName -ErrorAction SilentlyContinue)) { Write-Verbose "cciget: feed '$($feed.name)' not registered; skipping. Run Connect-CciGet first." continue } try { Find-PSResource -Name $Name -Repository $repoName -ErrorAction Stop | Add-Member -NotePropertyName Tenant -NotePropertyValue $feed.name -PassThru } catch { Write-Warning "cciget: Find-PSResource failed against '$repoName': $_" } } } |