KeDo_ProjectHelper.psm1
#* Everything listed here is project specific $FunctionScriptName = "ProjectHelper" Write-Verbose "Import-Start| [$($FunctionScriptName)]" # Lazy way to filter from table list #? Project specific function Get-ConfigValue($list, $Rkey, $Pkey) { return ($list | Where-Object { $_.RowKey -eq $Rkey -or $_.PartitionKey -eq $Pkey }).Value } # Get-Member from object - defaultFilter = ignore TableDefaults (e.g. PartitionKey / RowKey / TimeStamp) function MemberFilter ($in, $filter, [switch]$noDefaultFilter, [switch]$outHash) { $FilterList = @() ; $FilterList += $filter if ($outHash) { $returnlist = @{ } } else { $returnlist = @() } if (!($noDefaultFilter)) { $FilterList += ((Get-ConfigValue -list $DefaultConfig -Rkey "CTlockedRows").split(":")); $FilterList += @("DisplayName") } (($in | Get-Member -MemberType NoteProperty).Name | Where-Object { $_ -notin $FilterList }) | ForEach-Object { if ($outHash) { $returnlist += @{$_ = $in.$_ } } else { $returnlist += @{Property = $_;Value = $in.$_} } } return $returnlist } Export-ModuleMember -Function * Write-Verbose "Import-END| [$($FunctionScriptName)]" |