Skip to content

Commit

Permalink
Fix test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Mar 16, 2024
1 parent cad0466 commit 59fedef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/Store/private/Set-StoreVariable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.EXAMPLE
Set-StoreVariable -Name 'Name' -Value 'MyName'
#>
[CmdletBinding(SupportsShouldProcess)]
param(
# The name of the variable to set.
[Parameter(Mandatory)]
Expand All @@ -17,10 +18,12 @@
[object] $Value
)

if ($null -eq $Value) {
$script:Store.Remove($Name)
} else {
$script:Store.$Name = $Value
if ($PSCmdlet.ShouldProcess("Set variable '$Name' to '$Value'")) {
if ($null -eq $Value) {
$script:Store.Remove($Name)
} else {
$script:Store.$Name = $Value
}
Save-VariableStore
}
Save-VariableStore
}
8 changes: 6 additions & 2 deletions src/Store/public/Set-StoreConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@

switch ($PSCmdlet.ParameterSetName) {
'Variable' {
Set-StoreVariable -Name $VariableName -Value $Value
if ($PSCmdlet.ShouldProcess("Set variable '$VariableName' to '$Value'")) {
Set-StoreVariable -Name $VariableName -Value $Value
}
}
'Secret' {
Set-Secret -Name $SecretName -SecretValue $Value
if ($PSCmdlet.ShouldProcess("Set secret '$SecretName' to '$Value'")) {
Set-Secret -Name $SecretName -SecretValue $Value
}
}
}
}

0 comments on commit 59fedef

Please sign in to comment.