Breaking

Wednesday, March 11, 2015

Let's started with PowerShell: The basics

Learn how to perform simple tasks and make your way around the syntax.

Are you a Windows administrator? Did you make a new year's resolution to learn PowerShell in 2015? If so, you have come to the right place.

In this piece, I will get you started by orienting you to the world of PowerShell, helping you get your bearings and showing you how to perform simple tasks with the language so that you have a solid foundation on which to add skills for your particular job. Let's get started.

Get-Basics

PowerShell uses a consistent syntax for all of its commands -- in fact, PowerShell commands are actually called cmdlets, because they’re much more than simple DOS-style actions. All cmdlets use the following syntax:
Verb-Noun
You can easily remember it as "do something to" "this thing." For example, here are three actual cmdlets:
  • Set-ExecutionPolicy
  • Get-Service
  • Show-Command
All cmdlets will always follow this format. Using these three, you will set an execution policy, show a command or list of commands and get some information about a service and what it can do.
There are a few things to remember about using PowerShell at any time:
  • PowerShell is case-insensitive. UPPERCASE, lowercase, cAmElCaSe -- it doesn't matter. PowerShell simply reads the text in and performs the action you want.
  • Since PowerShell cmdlets are always consistently formatted, you can chain those cmdlets and their output together and do things in sequence. For example, one cmdlet can retrieve a list of things, and you can send that list (the output from that first command) to a second command, which then does things too. This can go on and on and on as long as you need it to until whatever task you want is complete.
  • The output of a PowerShell cmdlet is always a .NET object. This might not mean a lot to you right now, especially if you are not a programmer or don't have a software development background, but you will find as you learn more about the PowerShell language that this is where some of the real power in PowerShell lies.                                                                                                       
More Info :- InfoWorld

No comments:

Post a Comment