Windows PowerShell Methods
Windows PowerShell Methods
This section concentrates on pure PowerShell techniques. I will explain how to take those first few tentative steps on your journey to master PowerShell. If you review my techniques below, then you will get an idea of the range of PowerShell methods available. My aim is to help you develop an approach to writing PowerShell cmdlets (scripts), which suits your learning style.
Topics for PowerShell Methods
I have sequenced these PowerShell techniques. Thus if you are new to PowerShell I suggest that you start by going to the Control Panel, Progrmas and 'Turn Windows feature on' (or with Vista, downloading PowerShell from Microsoft's site).
Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft's operating systems. Fortunately, SolarWinds have created a Free WMI Monitor so that you can discover these gems of performance information, and thus improve your PowerShell scripts.
Take the guess work out of which WMI counters to use when scripting the operating system, Active Directory, or Exchange Server. Give this WMI monitor a try - it's free.
Contents of My PowerShell Method Pages
Each topic has its own 'how to' instructions and also 'Learning points'. As a result you will be able to modify my examples to suit your situation.
Basic Techique: Filtering the OutPut
There are two main methods of filtering the output of a PowerShell command, 'Where-Object' and the -Filter parmeter.
Find .txt Files Using the -Filter Parameter
# PowerShell -Filter Technique
Note 1: # (hash) means: 'Here follows a comment'.
Find .txt Files Using a Where-Object Statement
Not all PowerShell cmdlets support the -Filter parameter, thus it's useful to employ Where-Object.
# PowerShell Where-Object Technique
Note 2: Here is PowerShell's signature tune, the Pipe(|). This means the output of Get-ChildItem, becomes the input of the Where clause. After a while piping becomes second nature in PowerShell
Note 3: I frequently employ Clear-Host in my examples to provide a fresh slate and thus avoid confusion.
Here is an utility where you can review firewall settings such as access control lists (ACL), or troubleshoot problems with network address translation (NAT).
Other reasons to download this SolarWinds Firewall Browser include managing requests to change your firewall settings, testing firewall rules before you go live, and querying settings with the browser's powerful search options.
Guy recommends that you download a copy of the SolarWinds free Firewall Browser.
Other Windows PowerShell Topics
If you like this page then please share it with your friends
See more Windows PowerShell sections
Please email me if you have a better example script. Also please report any factual mistakes, grammatical errors or broken links, I will be happy to correct the fault.