Wednesday, December 23, 2009

Learn Windows PowerShell

Now SharePoint IT Professional should get ready for PowerShell. SharePoint 2010 has more than 500+ PowerShell Commands so tight your belts to get solid hands on PowerShell. I would like to start series on PowerShell Commands and Scripts to cover beginners and Advanced Users.




What is PowerShell?
Windows PowerShell is task based command line shell and scripting language designed for System Administrators. PowerShell is built on .NET Framework CLR and accepts and returns .NET Objects. Windows PowerShell includes an interactive prompt and scripting environment. Windows PowerShell does not process text. Instead, it processes objects based on the .NET Framework platform. Windows PowerShell comes with a large set of built-in commands with a consistent interface.



Windows PowerShell gives you access to the file system on the computer. In addition, Windows PowerShell providers enable you to access other data stores, such as the registry and the digital signature certificate stores, as easily as you access the file system. Windows PowerShell uses its own language



What is Cmdlet?
Cmdlet (pronounced "command-let") is a single-feature command that manipulates objects in Windows PowerShell. You can recognize cmdlets by their name format -- a verb and noun separated by a dash (-), such as Get-Help, Get-Process, and Start-Service. Most cmdlets are designed to be used in combination with other cmdlets. For example, the "get" cmdlets only retrieve data, the "set" cmdlets only establish or change data, the "format" cmdlets only format data, and the "out" cmdlets only direct the output to a specified destination. You can write your own cmdlets and share them with other users.



What are Processing Objects?
PowerShell indirectly uses objects of .NET framework. So what does it mean? .NET objects are instance of .NET Framework Class and these classes are data and methods (operations)associated with that data. But here think object as a Data entity that has Properties (which are Characteristics) and methods (which are actions that you can perform on object)
Major advantage of using PowerShell is it makes easier to pipeline commands, means to pass output of one command to another command as input. The cmdlet that receives an object can act directly on its properties, and methods.
You can send the output of a command to a file or printer, or you can use the pipeline operator () to send the output to another command.



What is Script?
If you run particular commands or command sequences repeatedly, or if you develop a series of commands to perform a complex task, you will want to save your commands in a file and execute the command file, instead of typing commands at the prompt. A file of commands is called a script.
In Windows PowerShell, script files have a .ps1 file name extension. To run a script, type the name of the script at the command prompt. The file name extension is optional. You must specify the fully qualified path to the script file, even if the script is in the current directory


Technorati Tags:



--


Thanks & Regards


Pramod Attarde


SharePoint Architect


Visit my Blogs at - http://sharepointproficient.spaces.live.com/


Join SharePoint 2010 Discussion Group on Linkedin - http://www.linkedin.com/groups?gid=2265830&trk=myg_ugrp_ovr

No comments:

Post a Comment