Level 1
0 / 100 XP

The Basics of PowerShell

  1. What is PowerShell? Look at the word POWER-SHELL. You may ask what is a shell?

A shell is a user interface that gives you access to the operating system.

  1. What can I use PowerShell for? PowerShell allows you to write scripts and use commands to automate repetitive tasks. For example:

You could check the security logs on one or a number of server’s, save that log file to a server as an HTML file and the Admins that work for you could check the log file every morning anywhere in the world to verify that your servers are not being attacked by hackers.

You can work with Active Directory, registry, WMI, backup your server, run tasks in the background while you perform other tasks.

3\. PowerShell is built into many products. Microsoft IT products, VMware, Citrix.

4\. Do you have a Linux, Unix or strictly Windows client background? You may ask, what commands from those O/S will PowerShell recognize?

PowerShell recognizes many windows native commands. Let’s check it out.

Open the ISE version of Powershell in Administrator mode

Type Explorer – Yep that works

Type Ipconfig /all

CHKDSK

CLS

Dir

MKDIR C:\ps2

Cmdlets are PowerShell specific commands. So how do we get a list of CMDlets?

Type get-command

Here we see a list of aliases -we’ll get to those later

And Functions – Functions are written in PowerShell’s own scripting language. You can create your own Functions in PowerShell.

CMDlets are native PowerShell commands that are written in a .net language

BTW you can get-help on any of these aliases, functions or cmdlets.

Let’s grab a command and get some help

And there’s your help for the Get-variable cmdlet

What about UNIX or Linux commands

Text
Type LS – Displays the contents of a specified location. PWD – Returns the current working directory name. MAN - Gives help on the get-service command. CAT -pa…