Remove-Secret
Removes a secret from a specified registered extension vault.
Syntax
NameParameterSet (Standardwert)
Remove-Secret
[-Name] <String>
[-Vault] <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
InfoParameterSet
Remove-Secret
[-InputObject] <SecretInformation>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Beschreibung
Removes a secret by name from a registered extension vault. Both the secret name and extension vault name must be provided.
Beispiele
Example 1
Remove-Secret -Name secretTest -Vault CredMan
Get-Secret -Name secretTest -Vault CredMan
Get-Secret: The secret secretTest wasn't found.
This example removes the secretTest
secret from the CredMan
vault. The Get-Secret
command
verifies that the secret no longer exists in the vault.
Example 2
Get-SecretInfo -Name Secret2 -Vault CredMan | Remove-Secret
Get-Secret -Name Secret2 -Vault CredMan
Get-Secret: The secret Secret2 wasn't found.
This example removes the Secret2
secret from the CredMan
vault. Get-SecretInfo
retrieves the
information for the secret and sends the result through the pipeline to Remove-Secret
.
Get-Secret
verifies that the secret no longer exists in the vault.
Parameter
-Confirm
Prompts you for confirmation before running the cmdlet.
Parametereigenschaften
Typ: | SwitchParameter |
Standardwert: | False |
Unterstützt Platzhalter: | False |
Nicht anzeigen: | False |
Aliase: | cf |
Parametersätze
(All)
Position: | Named |
Obligatorisch.: | False |
Wert aus Pipeline: | False |
Wert aus Pipeline nach dem Eigenschaftsnamen: | False |
Wert aus verbleibenden Argumenten: | False |
-InputObject
Specifies a SecretInformation object that describes a vault secret.
Parametereigenschaften
Typ: | Microsoft.PowerShell.SecretManagement.SecretInformation |
Standardwert: | None |
Unterstützt Platzhalter: | False |
Nicht anzeigen: | False |
Parametersätze
InfoParameterSet
Position: | 0 |
Obligatorisch.: | True |
Wert aus Pipeline: | True |
Wert aus Pipeline nach dem Eigenschaftsnamen: | False |
Wert aus verbleibenden Argumenten: | False |
-Name
Specifies the name of the secret to remove. Wildcard characters (*
) aren't permitted.
Parametereigenschaften
Typ: | String |
Standardwert: | None |
Unterstützt Platzhalter: | False |
Nicht anzeigen: | False |
Parametersätze
NameParameterSet
Position: | 0 |
Obligatorisch.: | True |
Wert aus Pipeline: | True |
Wert aus Pipeline nach dem Eigenschaftsnamen: | False |
Wert aus verbleibenden Argumenten: | False |
-Vault
Specifies the name of the vault to remove the secret from. Wildcard characters (*
) aren't
permitted.
Parametereigenschaften
Typ: | String |
Standardwert: | None |
Unterstützt Platzhalter: | False |
Nicht anzeigen: | False |
Parametersätze
NameParameterSet
Position: | 1 |
Obligatorisch.: | True |
Wert aus Pipeline: | False |
Wert aus Pipeline nach dem Eigenschaftsnamen: | False |
Wert aus verbleibenden Argumenten: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Parametereigenschaften
Typ: | SwitchParameter |
Standardwert: | False |
Unterstützt Platzhalter: | False |
Nicht anzeigen: | False |
Aliase: | wi |
Parametersätze
(All)
Position: | Named |
Obligatorisch.: | False |
Wert aus Pipeline: | False |
Wert aus Pipeline nach dem Eigenschaftsnamen: | False |
Wert aus verbleibenden Argumenten: | 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.