I am trying to design a GUI for Powershell that will allow me to search a CSV log file based on the criteria that I set. I have the following code that works when I run the code only from within ISE. When I launch my GUI and click the search button, I only get 1 result however I am expecting 2 results. Both results show up when I run the code from ISE:
(Import-Csv C:\User\Logs\Files\Calendar-Permissions-Log.csv | Where-Object {($_."Action" -eq "Remove Permissions") -or ($_."Action" -eq "Grant Permissions") -and ($_."Add/Remove User" -eq $Add_Remove_Email.Text) -and ($_."To/From Calendar" -eq $To_From_Email.Text) -and ($_."Permission" -eq $WPFSelect_Permission.Text) -and ($_."Trigger Date" -eq $Date.Text) -or ($_."Trigger Date" -eq $Date_Remove.Text) -and ($_."Delegate Flag Enabled" -like "Yes" -or $_."Delegate Flag Enabled" -eq $null) -and ($_."Can View Private Items" -like "Yes" -or $_."Can View Private Items" -eq $null)})."Task Name" | Out-GridView