In this post we discuss how to enable implicit uninstalls in SCCM using PowerShell and WMI. There are certain prerequisites for implicit uninstalls to work: You need to be running at least version 2107 of SCCM (MECM) You need to … Continue reading →
We can use PowerShell to calculate bit flags, so that we know which configurations have been set. For examples where we don’t want to create our own enum, we can read using PowerShell bitwise comparison operators to check and set … Continue reading →
When we’re scripting solutions, we need to understand how to concatenate strings and variables in PowerShell. “Concatenate” is just a posh word for joining/linking together. There are many ways to concatenate strings and variables in PowerShell – below are a … Continue reading →
A common question asked by scripting beginners is how do you comment out code in PowerShell? Luckily it’s simple. Commenting code is always good practise for a variety of reasons; one being if you pass your script on to a … Continue reading →
Sometimes we need to know how to determine the installed PowerShell version on a machine, since later versions come with additional features and improved performance. PowerShell 1.0 shipped with 129 cmdlets but PowerShell 2.0 had over 600 cmdlets! And over … Continue reading →
Passing multiple arguments to a PowerShell function can be slightly confusing, especially if coming from a VBScript background. You see, when calling a VBScript function with multiple arguments you specify a comma in between the arguments when you call the … Continue reading →
Occasionally we need to find the Product Name, Product Code and more for an installed MSI. It’s also handy to find the Install Source so we can see where i was installed from. There are various ways to achieve this … Continue reading →
It’s useful to know how to use PowerShell variables and object properties in a double-quoted string as part of PowerShell’s string expansion. As a simple example we cab expand the $name variable inside the $sentence variable like so: $name = … Continue reading →
When we want to check for the existence of files, folders and registry entries we can use Test-Path with PowerShell to return ‘true’ if it exists and ‘false’ if it doesn’t exist. Using Test-Path with Files and Folders Here we … Continue reading →
There are many instances where we need to use PowerShell comparison operators to compare strings and numbers. Here we go through some quick examples. Comparing Strings with PowerShell Here we use ‘eq’ to see if one string equals another. This … Continue reading →