src/Import-cciModule.ps1

function Import-cciModule {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        $Name,
        $destination = 'C:\CCI',
        [switch] $NoClobber
    )
    begin {
        Write-Verbose "Started running $($MyInvocation.MyCommand)"
    }
    process {
        if (!($NoClobber)) {
            if (Test-Path $destination\$Name) {
                Remove-Item -Path "$($destination)\$($name)" -Recurse -Force
            }
            if ($Name -in (Get-Module).Name) {
                Remove-Module $Name
            }
        }
        Get-cciModule -Name $Name -Destination $destination
        Import-Module "$($destination)\$($Name)\$($Name).psd1"
    }
    end {
        Write-Verbose "Finished running $($MyInvocation.MyCommand)"
    }
}