src/Get-cciModule.ps1
function Get-cciModule { [CmdletBinding()] param ( $modulename, $destination = 'C:\CCI' ) begin { Write-Verbose "Started running $($MyInvocation.MyCommand)" } process { if ($null -eq (Get-PSRepository -Name cciplatform -ErrorAction SilentlyContinue)) { Register-cciPlatformRepo } if (!(Test-Path $destination)) { New-Item $destination -ItemType Directory } $azStorageAccount = Get-AzStorageAccount $azStorageContainers = $azStorageAccount | Get-AzStorageContainer $azStorageContainerMatches = $azStorageContainers | Where-Object Name -eq $modulename $azStorageBlob = $azStorageContainerMatches | Get-AzStorageBlob $azStorageBlobContent = $azStorageBlob | Get-AzStorageBlobContent -Destination $destination } end { Write-Verbose "Finished running $($MyInvocation.MyCommand)" } } |