Hey Mackopes,
Thanks for putting this into a function!
I'm getting the error "WARNING: Invalid VIObject. Exiting" on every folder I try.
Whether standalone host or a folder in VCenter, I am getting this error. I used Get-Folder to verify the folder name I am using is correct.
Any thoughts?
Thanks!