Public/Get-ADPPronouns.ps1
function Get-ADPPronouns { <# .SYNOPSIS Get a user's Pronouns from ADP .DESCRIPTION Get a user's Pronouns from ADP .PARAMETER ADPObject Object which holds the Pronouns .EXAMPLE Input Object: ADP Object Return String: <Pronouns> .NOTES This is used when passing the full adp worker object from ADP's APID .FUNCTIONALITY Powershell Language #> [CmdletBinding()] param ( [Parameter( Mandatory = $true, Position = 0, ValueFromPipeline = $true )] $ADPObject ) $localPronouns = $null; try { $localPronouns = $ADPObject.person.preferredGenderPronounCode.shortName } catch {} switch ($localPronouns) { "She/Her/Hers" { $localPronouns = "she/her"; break } "He/Him/His" { $localPronouns = "he/him"; break } "They/Them/Theirs" { $localPronouns = "they/them"; break } "Ze/Zir/Zirs" { $localPronouns = "ze/zir"; break } default { $localPronouns = $null } } return ( $localPronouns | Get-ValidADPReturn ) } |