Last week I was working on a problem in a PowerShell forum. The admin was having problems getting Add-Computer to work. After a bit of "try this/try that" something became clear, and it's something that is easy to overlook. Especially when we get lulled into thinking PowerShell is omnipotent.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
Now, don't get me wrong -- PowerShell is making life dramatically easier for the Windows administrator. But because it is still a relatively new technology it is all to easy to fall into a mind trap when something goes wrong. We might think:
(A) PowerShell sucks because it can't do this!
(B) I'm new to PowerShell so I must be doing something wrong.
(C) PowerShell is broken.
While it's possible that any of these might actually be true in a given situation, often there's more to it. In the Add-Computer problem, the error messages were things like domain not found. After a few posts it became clear (to me at least) that this might be more than just a PowerShell problem. And sometimes you need an objective eye which is why forums are so helpful. It sounded more and more like a name resolution issue. I suggested he use non-PowerShell tools like DCDiag and NLTest to verify. If there had been PowerShell alternatives, I would have suggested them as well. But I have no problem running a commandline tool like DCDiag that is specifically designed for a single task. PowerShell is NOT omnipotent and you should use the right tool for the job.
The other point I'm trying to make is that sometimes you need to think outside of PowerShell. Are you trying to run a remote WMI query but it fails? Use WBEMTest to verify connectivity and your query. If it fails there it will fail in PowerShell. Trying to get a user with Get-ADUser but running into problems? Test with DSGet. If you can get something to work outside of PowerShell and the PowerShell equivalent still fails or doesn't perform as you expect, then we can say with much more certainty that there is a PowerShell issue. Now, it might simply be a knowledge issue, in which case a post to a PowerShell forum is warranted. Hopefully you'll get enough trustworthy expertise to either gain the necessary knowledge. realize there is a PowerShell limitation, or in the worse case discover a PowerShell bug. PowerShell is great, but far from complete or perfect. The Microsoft team knows that, the PowerShell community knows it, but we all work together to sort it all out.
So the next time you run into an issue with a PowerShell task, take a moment to think outside the console and use all the other tools in your administrator toolbox.