TEST OUT YOUR POWERSHELL SCRIPTS FIRST IN A NON-PRODUCTION ENVIRONMENT FIRST
March 26, 2011 4 Comments
You may be wondering why I applied such bad grammar to the title of this post, it came from a comment on this: https://www.nothingbutsharepoint.com/sites/itpro/Pages/Seven-Virtues-for-the-SharePoint-IT-Pro.aspx
PowerShell is a beast. Sure, it’s hard to learn the syntax, and there are 600+ commands that come along with SharePoint 2010. But, it also gives you direct access to the API for SharePoint. Never, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, ever, under any circumstances what-so-ever, run un-tested PowerShell code in a production environment. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever. ever.
What may have worked for one person, in which they have posted it on their blog, mailing list, or company-wide fax – it should be tested first, in a non-production environment.
It may work fine, sure, but, it may also grind everything to a halt, and end your career.
In closing, re-read the above, and make it your mantra. No go fourth, SharePoint admins (and devs – yes you too), and prosper.




And before running it on your test env, UNDERSTAND what the script does. Copy pasting random scripts from the internet and runing them on the farm without really understanding what they do is an even worse practice
Yes PowerShell is powerful, so in the hand of the novice its downright dangerous. I try to do all PowerShell development on a dedicated dev environment that i wipe ever so often to keep it stable.
Yes, not only important to test, but, to also understand. Thanks Anders!
Pingback: LotD: Using PowerShell to Approve List Items « Geoff Varosky's Blog
Pingback: PowerShell script to list all Webs and Site Templates in use within a Site Collection « Geoff Varosky's Blog