Skip to content
Menu
The Lonely Administrator
  • PowerShell Tips & Tricks
  • Books & Training
  • Essential PowerShell Learning Resources
  • Privacy Policy
  • About Me
The Lonely Administrator

PowerShell Is Not Omnipotent

Posted on September 7, 2010September 7, 2010

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.

Manage and Report Active Directory, Exchange and Microsoft 365 with
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.


Behind the PowerShell Pipeline

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to print (Opens in new window) Print
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

reports

Powered by Buttondown.

Join me on Mastodon

The PowerShell Practice Primer
Learn PowerShell in a Month of Lunches Fourth edition


Get More PowerShell Books

Other Online Content

github



PluralSightAuthor

Active Directory ADSI Automation Backup Books CIM CLI conferences console Friday Fun FridayFun Function functions Get-WMIObject GitHub hashtable HTML Hyper-V Iron Scripter ISE Measure-Object module modules MrRoboto new-object objects Out-Gridview Pipeline PowerShell PowerShell ISE Profile prompt Registry Regular Expressions remoting SAPIEN ScriptBlock Scripting Techmentor Training VBScript WMI WPF Write-Host xml

©2025 The Lonely Administrator | Powered by SuperbThemes!
%d