This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If ($Filter) | |
{ If ($Filter.ToUpper().IndexOf($Property.ToUpper()) -ge 0) | |
{ $Filter = $Filter.ToUpper().Replace($Property.ToUpper(),"`$Value") | |
Try { | |
[scriptblock]$Filter = [scriptblock]::Create($Filter) | |
} | |
Catch { | |
Write-Warning "$(Get-Date): ""$Filter"" caused an error, stopping script!" | |
Write-Warning $Error[0] | |
Exit | |
} | |
} | |
Else | |
{ Write-Warning "Could not locate $Property in the Filter, which is required. Filter: $Filter" | |
Exit | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment