Private/Convert-SyncHrEmpNo.ps1
function Convert-SyncHrEmpNo { [CmdletBinding(PositionalBinding=$true)] param ( [Parameter(Mandatory=$true)][string]$SyncHrEmpNo ) if ($SyncHrEmpNo -match '\D+\-\d+') { return ('{0:d8}' -f [int]($SyncHrEmpNo -split '-')[1]).Trim() } else { Write-Log -LogText "Error converting Sync HR EmpNo ""$SyncHrEmpNo""" -LogType: warning -EmployeeId $SyncHrEmpNo return $null } } |