Skip to content

Commit

Permalink
Set-TssSecret - fixing bug identified during testing
Browse files Browse the repository at this point in the history
Removing Template param as this is not usable on the endpoint
  • Loading branch information
wsmelton committed Apr 2, 2021
1 parent c14ae11 commit 9fc876b
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/functions/secrets/Set-Secret.ps1
Expand Up @@ -138,13 +138,6 @@ function Set-Secret {
[int]
$Site,

# Secret Template (ID)
[Parameter(ParameterSetName = 'all')]
[Parameter(ParameterSetName = 'general')]
[Alias('TemplateId')]
[int]
$Template,

# Check-In a Secret, can be combined with ForceCheckIn to forcibly check the Secret in
[Parameter(ParameterSetName = 'all')]
[Parameter(ParameterSetName = 'checkIn')]
Expand All @@ -154,7 +147,7 @@ function Set-Secret {
begin {
$setSecretParams = $PSBoundParameters

$generalParamSet = . $ParameterSetParams 'Set-TssSecret' 'general'
$generalParamSet = . $ParameterSetParams $PSCmdlet.MyInvocation.MyCommand.Name 'general'

# Need to know if any of the params provided are in the specific parameter sets
# if they are not we will null out the variable so the code below is not triggered
Expand All @@ -166,8 +159,8 @@ function Set-Secret {
}

# Require Get-TssSecret and PUT /secrets/{id} endpoint
$passwordParamSet = . $ParameterSetParams 'Set-TssSecret' 'password'
$folderParamSet = . $ParameterSetParams 'Set-TssSecret' 'folder'
$passwordParamSet = . $ParameterSetParams $PSCmdlet.MyInvocation.MyCommand.Name 'password'
$folderParamSet = . $ParameterSetParams $PSCmdlet.MyInvocation.MyCommand.Name 'folder'
$otherParams = @()
foreach ($p in $passwordParamSet) {
if ($setSecretParams.ContainsKey($p)) {
Expand All @@ -181,7 +174,7 @@ function Set-Secret {
}

# restricted params
$restrictedParamSet = . $ParameterSetParams 'Set-TssSecret' 'restricted'
$restrictedParamSet = . $ParameterSetParams $PSCmdlet.MyInvocation.MyCommand.Name 'restricted'
$restrictedParams = @()
foreach ($r in $restrictedParamSet) {
if ($setSecretParams.ContainsKey($r)) {
Expand Down Expand Up @@ -340,13 +333,6 @@ function Set-Secret {
}
$generalBody.data.Add('enableInheritSecretPolicy',$setSite)
}
if ($setSecretParams.ContainsKey('Template')) {
$setTemplate = @{
dirty = $true
value = $Template
}
$generalBody.data.Add('template',$setTemplate)
}
if ($setSecretParams.ContainsKey('IsOutOfSync')) {
$setOutOfSync = @{
dirty = $true
Expand Down

0 comments on commit 9fc876b

Please sign in to comment.