Powershell Create Function With Multiple Conditions Sql Developer