src/Install-CciPlatformModules.ps1
function Install-CciPlatformModules { [CmdletBinding()] param ( $subscriptionName="CCI Platform", $keyvaultName="CCI-Platform-KV", $secretName="PAT-clemenscomer-cciplatform-2018", $patusername="clemenscomer", $ModuleName ) begin { Write-Verbose "Started running $($MyInvocation.MyCommand)" } process { if ($null -eq (Get-PSRepository -Name cciplatform -ErrorAction SilentlyContinue)) { Register-CCIPlatformRepo } if ($null -eq $script:vstsCred) { $script:vstsCred = Get-CciVstsCredential @PSBoundParameters } if ($null -eq $ModuleName) { Install-Module -Repository CCIPlatform -Credential $script:vstsCred } else { Install-Module -Repository CCIPlatform -Credential $script:vstsCred -Name $ModuleName } } end { Write-Verbose "Finished running $($MyInvocation.MyCommand)" } } |