OK, thx for the recommendation. Replaced "1" by the count then, so it should always move off from the end, even a new item gets in.
while($SrcFldr.Items.Count -gt 0) {
$SrcFldr.Items[$SrcFldr.Items.Count].Move($DstFldr) | Out-Null
}
Thx Dianne, I was under the impression when defining
$EMails = $SrcFldr.Items
in Powershell $EMails would be a "static" list of all all objects in $SrcFldr.Items, but obviously it's dynamically changing while moving the items.
BTW: as using piping the objects into a ForEach-Object () loop...
Diane, thanks a lot for your hints!
Though I'm currently stuck with the following odd behaviour of the above little script, which however is a bit off-topic here.
Nevertheless I'm gonna mention it:
While working on a bigger number of mail items I noticed, that the ForEach loop doesn't process...
Thx a lot Diane,
> The only way would be to use run rules now command.
I already came across hints like this, however I understood it the way as if you'd have to read all defined rules first and execute them on the item one after another?
> Otherwise rules only run on mail downloaded from the...
OL16 64b on W10 64b
Hello,
I have a little powershell script which moves items to a PST files standard inbox.
How can I achieve that those mails get picked up by the rule engine as if they would have had arrived as incoming (e.g. same as the ones which get downloaded from a pop3 mbx)?
Thanks...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.