Functions/Authentication/PSCredential/MCM/Clear-MCMCredentials.ps1

<#
.DESCRIPTION
    This function removes ALL stored credentials in the current user's MCM Cache.
    The Metadata for preset credentials is maintained in $Global:PS_CredentialMetadata (via Import/Export-CredentialMetadata)
                                                                                      
#>

function Clear-MCMCredentials
{
    [CmdletBinding()]
    Param()
    Process
    {
        # Define Credential Metadata
        $Metadata = $Global:PS_CredentialMetadata        
        Foreach ($CM in $Metadata){Remove-MCMCredential -Name $CM.Name}
        write-host "All Credentials in $ENV:Username's MCM Cache have been cleared!" -ForegroundColor Yellow
    }
}