Close

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 Services for MANagement”, aka WS-MAN. […]

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 comparisons done on the command […]

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 on a given row (object) […]

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=> testfile.txt” Get-ChildItem | Out-File testfile.txt […]

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 possible. function – Small blocks […]

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 ———– —- ———- Alias Begin-WebCommitDelay […]

Read More

What is PowerShell?

Powershell is the main command line utility for Microsofts Windows Operating Systems. It comes pre-installed with Windows 7 and onwards. As well as Windows Server 2008 and onwards. It is immensely powerfull and is regularly used my system administrators to automate repetitive windows tasks. To open up the Powershell Console, go to: start -> all […]

Read More