src/Find-CciPlatformModules.ps1

function Find-CciPlatformModules {
    [CmdletBinding()]
    param (
        $subscriptionName="CCI Platform",
        $keyvaultName="CCI-Platform-KV",
        $secretName="PAT-clemenscomer-cciplatform-2018"
    )
    begin {
        Write-Verbose "Started running $($MyInvocation.MyCommand)"
        Register-CCIPlatformRepo
    }
    process {
        Login-AzureRmAccount -Subscription $subscriptionName -Credential (Get-Credential)
        $secretValue = (Get-AzureKeyVaultSecret -VaultName $keyvaultName -Name $secretName).SecretValueText
        $pat = ConvertTo-SecureString $secretValue -AsPlainText -Force
        $vstsCred = New-Object PSCredential -ArgumentList 'clemenscomer', $pat
        Find-Module -Repository CCIPlatform -Credential $vstsCred
    }
    end {
        Write-Verbose "Finished running $($MyInvocation.MyCommand)"
    }
}