Thank you. I didn't think to try that. Good to know. I am sure others may find this helpful.
Yes V2 and earlier Net/PowerShell does not dynamically load type. My best guess is that MS PS Team decided to always load [System.__ComObject] or they have used it in PS init so it is now always loaded.
You can use [object] instead. That type works for anything and will not alter the underlying object.
Using [__ComObject] in PoSH v2
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.