SecretManagement.KeePass.Extension/Public/Unregister-SecretVault.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
using namespace System.Management.Automation
function Unregister-SecretVault {
    [CmdletBinding()]
    param(
        [string] $VaultName,
        [hashtable] $AdditionalParameters
    )
    try {
        Remove-Variable -Name "Vault_$VaultName" -Scope Script -Force -ErrorAction Stop
    } catch [ItemNotFoundException] {
        Write-Verbose "Vault ${VaultName}: Vault was not loaded at time of deregistration"
    }
}