Skip to content

Commit

Permalink
Security warning
Browse files Browse the repository at this point in the history
Add-MyMember
  • Loading branch information
rulasg committed May 24, 2023
1 parent 96be33c commit 84c9a21
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Docs.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1156,11 +1156,13 @@ function Add-MyMember
[parameter(Mandatory)][string]$NotePropertyName,
[parameter(Mandatory)][string]$NotePropertyValue
)

if ($Object.$NotePropertyName) {
$Object.$NotePropertyName = $NotePropertyValue
} else {
$object | Add-Member -NotePropertyName $NotePropertyName -NotePropertyValue $NotePropertyValue
}
process {

if ($Object.$NotePropertyName) {
$Object.$NotePropertyName = $NotePropertyValue
} else {
$object | Add-Member -NotePropertyName $NotePropertyName -NotePropertyValue $NotePropertyValue
}
}
}
#endregion Utils
#endregion Utils

0 comments on commit 84c9a21

Please sign in to comment.