Executing Powershell From Cmd Line

In the last article, we verified that Windows PowerShell was installed on my laptop and determined the version of the scripting engine. This tallk will be center around how to execute scripts from the command line. For a simple test case, I created a C:\TEMP directory. Inside that directory is a script named “LIST-ROOT.PS1” that will change the directory to the root node on the C drive. After this action, the contents of the root directory is listed for review.

Lets try executing the script from a command line….

Installing Windows PowerShell

PowerShell comes installed as part of the operating system in Windows 7. I checked my system which is a base install of Windows 7 SP1. The ISE or integrated scripting envrionment is the place to code, debug and launch scripts. To open the development environment, type powershell_ise at the run or command prompt to launch the application. At this point, you have to decide if you can live with the current version or install the new version. There are two commands that can be used to find the version. The…