PowerShell – Windows Media Instrumentation (WMI)

WMI is a standalone component and Powershell only interacts with it. WMI essentially houses a massive collection of system information and tries to organise this data in a meaningful way. Here is very useful guide: At the top level, WMI is organised into namespaces (which are a bit like folders […]Read more »

PowerShell – Run commands on remote machines

PowerShell lets you run commands on a remote machine. You can even run commands that exist on the remote machine, but doesn’t exist in your local machine (since you have not installed it on your local machine). PowerShell manages to do this by using it’s own communication protocol called “Web […]Read more »

PowerShell – Filtering and Comparisons

Chapter 11 – Filtering and comparisons There is basically 2 approaches to filtering a command’s output: 1. Using wildcards 2. Using the where-object command. 1. Using wildcards e.g.: get-service -name e*,*x* # returns anything where the name property either begins with “e” or contains the letter “x” Here are some […]Read more »

PowerShell – Changing a command output’s default formatting

Chapter 10 – changing the default formats of a command’s output Every time a command outputs a table of data, the output actually gets (invisibly) piped to the Out-Default command. This in turn pipes the data (invisibly) to the defualt destination, which is, which by default is “out-host”, which is […]Read more »

PowerShell – A deeper understanding of the pipeline

Chapter 9 – A deeper understanding of the pipeline When piping data from one command to the next, there are times when you need to help the receiving command understand what data it is receiving from the inputing pipe. This is done by forwarding the piped data to a command’s […]Read more »

PowerShell – Data in the form of “objects”

In PowerShell, there are lots of commands that gives tabular data, e.g. get-process In PS, we have some terminologies that describes different parts of these tables: collection: This refers to the whole table. object: single row in the table property: column in the table method: action that you can take […]Read more »

PowerShell – Combine commands together using pipes

compare-object # similar to the diff command. but has a lot more feature for comparing tabular data. Hence can be used to compare # what is and is-not installed as well as versions for ordnance survey. ## Redirection Get-ChildItem | Out-File testfile.txt # This is the same as “ls -l=> […]Read more »

PowerShell – Running commands

There are different types of commands that you can run on the PowerShell Command line: cmdlet – Name for any powershell builtin command, e.g. get-service, set-location, get-childitem….etc aliases – these are nicknames for other commands. You can view a list of aliases using get-alias. It’s best to avoid aliases where […]Read more »

PowerShell – Using the builtin help system

Accessing the built-in help Powershell comes with a builtin help manual, which is really useful and is something you will rely on heavily. There are hundreds of commands at your disposal, you can view a whole list of them by running the get-command command: PS C:\Windows\system32=> Get-Command CommandType Name ModuleName […]Read more »