Compartir a través de


Register-SecretVault

Registers a SecretManagement extension vault module for the current user.

Sintaxis

Default (Es el valor predeterminado).

Register-SecretVault
    [-ModuleName] <String>
    [[-Name] <String>]
    [-VaultParameters <Hashtable>]
    [-DefaultVault]
    [-AllowClobber]
    [-PassThru]
    [-Description <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

This cmdlet adds a SecretManagement extension vault to the current user's vault registry. An extension vault is a PowerShell module that conforms to the required extension vault format. This cmdlet verifies that the specified module meets conformance requirements before adding it to the extension vault registry. Extension vaults are registered to the current user and don't affect other user vault registrations.

The first vault registered with this cmdlet is automatically defined as the default vault even if the DefaultVault parameter isn't specified.

Ejemplos

Example 1

Register-SecretVault -Name LocalStore -ModuleName Microsoft.PowerShell.SecretStore -DefaultVault
Get-SecretVault
VaultName  ModuleName                        IsDefaultVault
---------  ----------                        --------------
CredMan    Microsoft.PowerShell.CredManStore False
LocalStore Microsoft.PowerShell.SecretStore  True

This example registers a Microsoft.PowerShell.SecretStore extension vault for the current user. It uses the DefaultVault parameter to make the registered vault the default vault for the user. Get-SecretVault lists all registered vaults for the user, verifying the vault was registered and set as the default vault.

Example 2

$parameters = @{
    Name = 'Azure'
    ModuleName = 'Az.KeyVault'
    VaultParameters = @{
        AZKVaultName = 'AzureKeyVault'
        SubscriptionId = (Get-AzContext).Subscription.Id
    }
    DefaultVault = $true
}
Register-SecretVault @parameters
Get-SecretVault
Name  ModuleName  IsDefaultVault
----  ----------  --------------
Azure Az.KeyVault True

This example registers an Az.KeyVault extension vault for the current user. The Az.KeyVault module needs to be installed on prior. For the VaultParameters:

  • AZKVaultName specifies the name of the Key Vault on Azure
  • SubscriptionId specifies the ID of the subscription where the Key Vault is created in

Parámetros

-AllowClobber

If specified, allows the cmdlet to overwrite an existing registered extension vault with the same name.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False
Alias:cf

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-DefaultVault

If specified, sets the new extension vault as the default vault for the current user.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-Description

Describes the vault. This value is included in the vault registry information.

Propiedades del parámetro

Tipo:String
Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-ModuleName

Specifies the name of the PowerShell module that implements the extension vault. Enter the name of a module or the path to the module. If you specify a name, PowerShell searches for it in the known module paths. If you specify a path, PowerShell searches that path for the module.

Propiedades del parámetro

Tipo:String
Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:1
Mandatory:True
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-Name

Specifies the name of the extension vault. If no name is specified, the module name is used as the vault name.

Propiedades del parámetro

Tipo:String
Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:0
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-PassThru

Indicates that the cmdlet should return the SecretVaultInfo object for the successfully registered extension vault. By default this cmdlet doesn't return any output.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-VaultParameters

Specifies a Hashtable object containing optional key-value pairs used as parameters by the extension vault. These parameters are optional. Consult the documentation of the vault extension module to see what values are required.

Propiedades del parámetro

Tipo:Hashtable
Valor predeterminado:None
Admite caracteres comodín:False
DontShow:False

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet isn't run.

Propiedades del parámetro

Tipo:SwitchParameter
Valor predeterminado:False
Admite caracteres comodín:False
DontShow:False
Alias:wi

Conjuntos de parámetros

(All)
Posición:Named
Mandatory:False
Valor de la canalización:False
Valor de la canalización por nombre de propiedad:False
Valor de los argumentos restantes:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Entradas

None

Salidas

None