Perfect! Works for me with this code. I added back the code to delete the xml files as for some reason it wasn't cleaning up all of the time.
I was playing around with this and found that without any filter on the PolicyStore it would not pull anything back.
I commented out the where-object portion and it worked perfectly.
I was playing around with this and found that without any filter on the PolicyStore it would not pull anything back.
I commented out the where-object portion and it worked perfectly.