src/Connect-cciAzAccount.ps1
function Connect-cciAzAccount { [CmdletBinding()] param ( $subscriptionName ) begin { Write-Verbose "Started running $($MyInvocation.MyCommand)" $cciConnectionParams = Get-cciConnectionParams if (!($subscriptionName)) { $subscriptionName = $cciConnectionParams.AzAccount_subscriptionName } } process { while (!(Get-AzContext)) { Write-Verbose "Logging in to $($subscriptionName)..." Connect-AzAccount -SubscriptionName $subscriptionName #-Credential (Get-Credential) } } end { Write-Verbose "Finished running $($MyInvocation.MyCommand)" } } |