Understanding Functions In Powershell

When first starting out writing PowerShell scripts you’re not necessarily concerned about things such as modularity, reusability and “best practices.” You’re just getting your feet wet. However, as time goes on, you’ll soon realize that you begin repeating yourself in code. You’ll notice that the need to do the same thing over and over keeps getting greater. You could just […]

Read more

How To Deal With Dependencies In Your Pester Infrastructure Tests

Infrastructure tests are different, and it’s important to be aware of dependencies when doing so. When writing Pester infrastructure tests, you’ll cross a common problem; dealing with dependencies. This is because, unlike unit tests, infrastructure tests actually run real code and touch the real environment. And real environments are complicated and full of dependencies on compute, networking, storage, etc. To […]

Read more

Where-Object Vs. The Where Method: Array Filtering In Powershell

PowerShell, like all other scripting languages, has ways to bring different pieces of data together into a collection. These “collections” refer to different types of variables that hold more than one value. For example, two popular types of collections in PowerShell are arrays and hashtables. The scenario and type of collection you’re filtering will determine the best way to filter […]

Read more

Building HTML Reports In Powershell With Convertto-Html

Let’s say you’ve developed this excellent script that pulls all kinds of information from various sources that save you and your team tons of time. This script pulls information from Active Directory, some HR database, your VMware/Hyper-V nodes and so on. How it correlates all of that information is really a huge time-saver for you. You present it to a […]

Read more

Powershell Streams: Write-Host, Write-Output, Write-Verbose, Write-Error

Whenever you see some text come up in a PowerShell console, that text may not necessarily be the same “type.” Whether the text is white, red, green, or whatever, that text may come from one of five different streams. Streams are essentially like roads the output you see in the console takes to get there. The code that’s responsible for […]

Read more
RSS WordPress Plugin by WP Tutor.io
1 2 3 4 41