Helper/Add-BCDevObjectProperty.ps1
function Add-BCDevObjectProperty { param ( [Parameter(Position=0, Mandatory=$true)] [PSObject]$Object, [Parameter(Position=1, Mandatory=$true)] [string]$PropertyName, [Parameter(Position=2, Mandatory=$false)] $PropertyValue ) if (!($Object.psobject.Properties.Name -eq $PropertyName)) { if ($PropertyValue) { Add-Member -InputObject $Object -MemberType NoteProperty -Name $PropertyName -Value $PropertyValue } else { Add-Member -InputObject $Object -MemberType NoteProperty -Name $PropertyName } } Return $Object } Export-ModuleMember -Function Add-BCDevObjectProperty |