Improuving Powershell cmdlet performances
I have written thousands of powershell lines to manage SCCM from powershell. I really don't understand why powershell cmdlets are so slow comparing to wmi ones. I really suggest to try to improve it.
Feel free to file bugs via connect or at a open suggestions here that are more specific. In its current form there’s not much action for us to take on this suggestion.
I've noticed that accessing SCCM SMS Provider through CIM is even a more pleasant experience that through WMI, Unfortunately not everything can be done through CIM elegantly enough (i.e. complex queries that involve joining data from multiple tables would require running individual queries against each class filtering out results on the SMS Provider client side)
AdminAdam Meltzer (ConfigMgr Product Team) (Software Engineer, Microsoft Endpoint Configuration Manager) commented
PowerShell cmdlets as a whole shouldn't be noticeably slower than operations through the admin console or directly through the SMS Provider. There are some instances where we're using inefficient queries in cmdlets and these should definitely be fixed.
If you have specific cases of slowness when performing something through PowerShell versus directly through WMI please file a bug on Connect with more details so we can look into fixing this for a future release.