Remove-Secret
Removes a secret from a specified registered extension vault.
Синтаксис
NameParameterSet (по умолчанию)
Remove-Secret
[-Name] <String>
[-Vault] <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
InfoParameterSet
Remove-Secret
[-InputObject] <SecretInformation>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Описание
Removes a secret by name from a registered extension vault. Both the secret name and extension vault name must be provided.
Примеры
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.
Параметры
-Confirm
Prompts you for confirmation before running the cmdlet.
Свойства параметра
Тип: | SwitchParameter |
Default value: | False |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Aliases: | cf |
Наборы параметров
(All)
Position: | Named |
Обязательно: | False |
Значение из конвейера: | False |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
-InputObject
Specifies a SecretInformation object that describes a vault secret.
Свойства параметра
Тип: | Microsoft.PowerShell.SecretManagement.SecretInformation |
Default value: | None |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Наборы параметров
InfoParameterSet
Position: | 0 |
Обязательно: | True |
Значение из конвейера: | True |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
-Name
Specifies the name of the secret to remove. Wildcard characters (*
) aren't permitted.
Свойства параметра
Тип: | String |
Default value: | None |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Наборы параметров
NameParameterSet
Position: | 0 |
Обязательно: | True |
Значение из конвейера: | True |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
-Vault
Specifies the name of the vault to remove the secret from. Wildcard characters (*
) aren't
permitted.
Свойства параметра
Тип: | String |
Default value: | None |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Наборы параметров
NameParameterSet
Position: | 1 |
Обязательно: | True |
Значение из конвейера: | False |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Свойства параметра
Тип: | SwitchParameter |
Default value: | False |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Aliases: | wi |
Наборы параметров
(All)
Position: | Named |
Обязательно: | False |
Значение из конвейера: | False |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | 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.