The New PowerShell in a Nutshell
Microsoft Windows and Microsoft DOS components and hardware’s used in personal computers always includes an interface program which is a command line tool in all there releases. Most common are the cmd.exe and command.com, the command.com usually refers to systems relying on Ms-Dos and in even the new Windows 9X. The cmd.exe on the other hand, normally comes with operating systems in the Windows NT family.
Basically, these are interpreters of simple command line. For more complex strings of commands, separate application consoles are needed. These mentioned interpreters are considered shells that are like the base of the available console applications. Batch files are also available which is considered a scripting language. Use of these batch files enables automation of several different tasks. However not all GUI functionality cannot be automated because equivalents of command lines and operations through its interface especially in graphics are exposed and limited. Scripting language is basically elementary and doesn’t allow complex scripts to be created. In the year 2003 Windows Server’s had a lot of improvements but still support in scripting was unsatisfactory still.
The main idea behind scripting is the ability to do much more in lesser time. Without using a script like in adding hundreds of users in a directory would surely take hours. With scripts one can do the task easily because of a few strings written, it can be automated to repeat a singular task when the script is executed. Since Windows 2000, all scripting was so limited and somewhat needed to be long and complex scripts written in VBScript language, which is a version of Visual Basic. Batch Scripting was the only alternative option available for system administrators. VBScript was considered a functional programming language which is capable of doing almost anything in script language. The only limitations on Batch Scripts were pre-built commands which were standard in Microsoft programming or from third party developers. One of Batch Scripting advantages over VBScript is that it is easily learned. A few basic commands in Batch Scripts are enough to learn and develop Batch Scripts.
The problem with VBScript is that it required much knowledge of complex and often very unpractical programming concepts. Studying and mastering VBScript takes more time and patience, meaning that time in understanding the said language could highly affect the quality of programmers and the output of the scripts they make. Another fact is that in VBScript language a lot of effort in troubleshooting is required. In most cases, it takes more time to make the script than actually performing the task manually. In short, VBScript is very limited to repetition tasks that are needed to be done. In addition, a number of security issues and concerns are surrounding VBScript’s platform.
VBScript and Batch Scripting was always in spotlight especially in the script writing world, and because of the competition that existed between these two, Windows is bombarded with lots of systems administrators complains stating that Windows is lacking a truly functional and user friendly script language. Because of this, Microsoft finally decided to develop a scripting system which is entirely new that has the functionality of the VBScript and made its language easier to understand and master like in Batch scripting. The result of this much awaited move by Windows is PowerShell.
But the biggest mistake most beginners do in learning PowerShell is approaching it the way they used the other said scripting language. But what many people don’t realize is that it doesn’t really have to be handled as a normal scripting language. PowerShell can be approached just like the way command prompt is used. And in doing this, it is still possible to do many powerful administrative scripts with it. The first basic thing needed to know is how actually to access PowerShell. There are basically a few ways available, the simplest way is just by typing Powershell in the Run box or at the command prompt. Another simple way to access Powershell is by double clicking a .ps1 file, an ordinary text file that contains Powershell statements.
What PowerShell does is that if an executable program command is made, it launches the said program on a separate process. If said command is a type of cmdlet, it is then executed with PowerShell. It provides also a command line interface which is interactive, wherein their output is displayed when commands are entered. User interface is basically based on Win32, though it lacks highlighting of syntax its tab completion is very customizable. Aliases for cmdlets can be created in PowerShell, which are translated textually by PowerShell into original invocations of commands. It also supports positional and named parameters used in commands. In cmdlet execution, binding the needed argument value to a parameter is simply done in PowerShell itself, for external executables arguments they are transferred via equivalent variable array or argv which is parsed with the executable.
It was first unveiled publicly during the Professional Developers Conference held in September of 2003. PowerShell initially was using the name “Monad”. Microsoft currently supports two versions of PowerShell, in 2006 the version 1.0 was used for Windows Vista, Windows Server 2003, and Windows XP SP2/SP3 and an optional feature for Windows Server 2008. While the version 2.0 is installed with Windows Server 2008, Windows Vista with Service Pack 1, Windows Server 2003 with Service Pack 2, Windows XP with Service Pack 3, Windows Server 2008 R2, and Windows 7.The first ever Monad beta was released on June 17 2005 in the public. The Beta 2 followed on September 11, 2005, while the Beta 3 was released on January 10, 2006. Windows then decided to use the PowerShell branding, changing it from Monad last April 25, 2006. Windows considered this as a significant change and part in their management technology. PowerShell Release Candidate 1 was also released during the same time. While Release Candidate 2 was later released on September 26, 2006 and was made available in the web on November 14, 2006. A PowerShell version for Vista was then released on January 30, 2007. Windows released the last preview of PowerShell v2.0 to its community technology on December of 2008.