Creating a PowerShell Module to Improve Your Code
Do you have PowerShell code that you reuse in your scripts over and over? Do you have server names hard coded in variables? Are you using a text file or CSV file to import server names? Do you find yourself only utilizing one server out of a cluster of servers to make your PowerShell commands? These are the questions I asked myself and the answer used to be YES. In this post, I will go over how you can store your infrastructure server information in a SQL database and call that data from a custom PowerShell module. By utilizing this method, you can expect the below benefits:
Centralized code means less places to modify if you want to make a change
Randomized server selection to prevent over usage of one server
Centralized location to store server information
Easily add or remove server infrastructure as your environment changes
Flexibility to pull server data from multiple sites and locations
Standardized scripts make for easier readability and debugging
Feel free to check it out for yourself at my site: SpiderZebra.com Nick Richardson (@ChiefNSR)
Related Articles
Writing Your Own PowerShell Functions / Cmdlets
This article is an attempt at describing some of my thought process when building functions. By functions I mean a command …
Read moreMedia Sync: Organize Your Photos and Videos with PowerShell
Do you have photos and videos that you have taken over the years that are scattered all over the place? Do you want to have …
Read moreNetNeighbor Watch: The PowerShell Alternative To Arpwatch
In this post, we are going to setup NetNeighbor Watch on a Raspberry Pi. NetNeighbor Watch can keep an eye on your network …
Read more