Skip to content

Commit

Permalink
Merge pull request #236 from MicrosoftDocs/main
Browse files Browse the repository at this point in the history
8/26/2024 PM Publish
  • Loading branch information
Taojunshen authored Aug 26, 2024
2 parents 9ba48cf + 7f293f4 commit 87802a9
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,4 @@ $EncryptedInput = ConvertTo-SecureString -String $UserInput -AsPlainText -Force

```powershell
$SecureUserInput = Read-Host 'Please enter your secure code' -AsSecureString
$EncryptedInput = ConvertFrom-SecureString -String $SecureUserInput
$SecureString = ConvertTo-SecureString -String $EncryptedInput
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
Module Name: Microsoft.PowerShell.SecretManagement
Module Guid: a5c858f6-4a8e-41f1-b1ee-0ff8f6ad69d3
ms.date: 05/31/2022
ms.date: 08/26/2024
Download Help Link: https://aka.ms/ps-modules-help
Help Version: 0.1.0.0
Locale: en-US
Expand All @@ -17,15 +17,6 @@ PowerShell module that has been registered to SecretManagement, and exports five
required by SecretManagement. An extension vault can store secrets locally or remotely. Extension
vaults are registered to the current logged in user context, and are available only to that user.

> [!NOTE]
> This module is supported under traditional Microsoft support agreements, including
> [paid support](https://support.microsoft.com/hub/4343728/support-for-business),
> [Microsoft Enterprise Agreements](https://www.microsoft.com/licensing/licensing-programs/enterprise?rtc=1&activetab=enterprise-tab%3aprimaryr2),
> and [Microsoft Software Assurance](https://www.microsoft.com/licensing/licensing-programs/software-assurance-default.aspx).
> You can also pay for [support](https://support.microsoft.com/contactus) for PowerShell by filing a
> support request for your problem. Please file issues in the source repository using the
> **This product** button in the Feedback section at the bottom of the page.
## Microsoft.PowerShell.SecretManagement Cmdlets

### [Get-Secret](Get-Secret.md)
Expand Down Expand Up @@ -55,5 +46,8 @@ Sets the provided vault name as the default vault for the current user.
### [Test-SecretVault](Test-SecretVault.md)
Runs an extension vault self test.

### [Unlock-SecretVault](Unlock-SecretVault.md)
Unlocks an extension vault so that it can be access in the current session.

### [Unregister-SecretVault](Unregister-SecretVault.md)
Un-registers an extension vault from SecretManagement for the current user.
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
external help file: Microsoft.PowerShell.SecretManagement.dll-Help.xml
Module Name: Microsoft.PowerShell.SecretManagement
ms.date: 08/26/2024
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.secretmanagement/unlock-secretvault?view=ps-modules&wt.mc_id=ps-gethelp
schema: 2.0.0
---

# Unlock-SecretVault

## SYNOPSIS
Unlocks an extension vault so that it can be accessed in the current session.

## SYNTAX

```
Unlock-SecretVault [-Name] <String> [-Password] <SecureString> [<CommonParameters>]
```

## DESCRIPTION

This cmdlet unlocks an extension vault using the provided **Password**. This allows a vault that
requires password authentication to operate without first having to prompt the user. Not all
extension vaults require password authentication. The cmdlet returns a warning if the extension
vault doesn't support unlocking via password.

## EXAMPLES

### Example 1

```powershell
Unlock-SecretVault -Name SecretStore -Password $SecurePassword
Get-SecretInfo -Vault SecretStore
```

```Output
Name Type VaultName
---- ---- ---------
Secret1 SecureString SecretStore
Secret2 SecureString SecretStore
```

This example uses the command to unlock the `SecretStore` vault. It then runs the `Get-SecretInfo`
command on the vault without being prompted for the vault password.

### Example 2

```powershell
Unlock-SecretVault -Name CredMan -Password $SecurePassword
```

```Output
WARNING: Cannot unlock extension vault 'CredMan': The vault does not support the Unlock-SecretVault
function.
```

This example uses the command to unlock the `CredMan` vault. But the vault doesn't support unlocking
so the command has no effect. A warning is displayed informing that `CredMan` vault doesn't support
unlocking.

## PARAMETERS

### -Name

Name of the vault to unlock.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Password
Password used to unlock the vault.
```yaml
Type: System.Security.SecureString
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
### None
## OUTPUTS
### System.Object
## NOTES
## RELATED LINKS

0 comments on commit 87802a9

Please sign in to comment.