Forum Discussion
FormindGMO
Mar 18, 2022Copper Contributor
Outlook et Powershell - search doesn't yield results each time
Hi Team: As I try to run this little Powershell script: $outlook = new-object -com Outlook.Application;
$namespace = $outlook.GetNameSpace("MAPI");
$inputFolderObj=$namespace.Folders...
Mar 19, 2022
It does retrieve the correct number, but you have to wait a few seconds. It first returns 0 in my case too, but when I run $search.Results.Count again it shows 11 which was correct for the folder. Seems like the process is not ready when asking for the count after the search immediately?
Mar 23, 2022
Did it fix your issue if you put a start-sleep -seconds 10 after $search = $outlook.AdvancedSearch("'$scope'", $filter, $True) ?