Unlock-PSSMSecretVault
SecretManagement: Unlocks a secret vault
#Requires -Version 5.1
#Requires -Modules Microsoft.PowerShell.SecretManagement
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$VaultName,
[Parameter(Mandatory = $true)]
[securestring]$StorePassword
)
Process {
try {
Unlock-SecretVault -Name $VaultName -Password $StorePassword -ErrorAction Stop
[PSCustomObject]@{ Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"; Status = "Success"; VaultName = $VaultName; Message = "Vault '$VaultName' unlocked" }
}
catch { throw }
}Name of the vault to unlock
Password to unlock the vault