In the Beginning
How did it all start?
Like any other day I’m trying to work My PowerShell Fu-Do to create a tool to aid my cohorts, aid me.
The tool a mashup of Win32_DiskDrive and Win32_Volume classes to create a new Custom Object. The point of which is to gather the information I need to extend storage on the SAN .
Little Google Fu-Do and a great article from @Don Jones
Windows PowerShell: The Many Ways to a Custom Object gets me started
Which Led to My 12 PowerShell Best Practices
By the way of the 12 Practices
- Never use Write-Host …. I don’t I love Puppies!!
- Avoid $ErrorActionPreference … Wasn’t aware of it Score for ignorance
- Indent your Code
- Spell out cmdlet and and parameter names I do mostly
- Don’t use Hungarian Notation … Ok … but can I still use Camel-Case?
- Use Multi-Purpose comments
- Use mostly single quotes
- Use Source control –Working on with internal Team Foundation Server our Dev group uses, we are moving InfraScrum to it from Jira… Maybe.
- Use Code signing already implemented in house with our internal CA
- Use cmdlet style naming
- Avoid Global scope
- Output objects… The reason this article started
That got me to thinking. Best practice implementation leads to maturity as you strive to make your enterprise the best it can be.
My take ways were
- Security First
- Use good coding practice
- Don’t use Write-Host puppies puppies puppies
- Get Ops to learn good Development Skills and practices
- Use a repository like GIT stop storing your scripts all over the environment. They end up like being pockets of Ebola.
- Code Re-use
- Ad Nauseum
As Operations folks we need to learn some better practices around how we write code and we are going to write more code in future infrastructure operations.
To me maturity is indicated by standard processes that are repeatable by all team members. Standard repeatability is aided by templating your environment. Maturity aids workflow reduces chaos.
Some of the process areas I’m thinking through involve the use of a TFS Git repository as we consider moving our Agile SCRUM process from Jira to the Team Foundation Server. Our team has seen this as positive move to help merge our teams as we move into the DevOps culture.
This is the first of hopefully many Blog Posts…