Whether you're new to programming or an experienced developer, we'll help you get started with PowerShell. In this document we'll cover the following: installing PowerShell, samples walkthrough, PowerShell editor, debugger, testing tools and a map book for experienced bash users to get started with PowerShell faster. The exercises in this document are intended to give you a solid foundation in how to use PowerShell. You won't be a PowerShell guru at the end of reading this material but you will be well on your way with the right set of knowledge to start using PowerShell. If you have 30 minutes now, let’s try it.
First you need to set up your computer working environment if you have not done so. Choose the platform below and follow the instructions. At the end of this exercise, you should be able to launch the PowerShell session.
-
PowerShell on Windows
For this tutorial, you do not need to install PowerShell if you are running on Windows. You can launch PowerShell command console by pressing Windows Key and typing PowerShell, and clicking on 'Windows PowerShell'.
TODO: Raghu for setup-dev-environment.md
PowerShell command has a Verb-Noun structure with a set of parameters. It's easy to learn and use PowerShell. For example, Get-Process
will display all the running processes on your system. Let's walk through with a few examples by clicking on the PowerShell Beginner's Guide.
Now you have learned the basics of PowerShell. Please continue reading: Editor, Debugger, and Testing Tool if you want to do some development work in PowerShell.
In this section, you will create a PowerShell script using PowerShell editor. You can certainly use your favorite editor to write scripts. As an example, we use Visual Studio Code (VS Code) which works on Windows, Linux, or OS X. Click on the following link to create your first PowerShell script.
On Windows, you can also use PowerShell Integrated Scripting Environment (ISE) to edit PowerShell scripts.
Assuming you have written a PowerShell script which may contains a software bug, you would like to fix the issue by using debugging. As an example, we use VS Code. Click on the link below to learn more about debugging:
On Windows, you can also use ISE to debug PowerShell scripts.
We recommend using Pester testing tool which is initiated by the PowerShell Community for writing test cases. To use the tool please read Pester Guides and Writing Pester Tests Guidelines.
TODO: Don & JP to fill in
Bash | PowerShell | Description |
---|---|---|
ls | ls | List files and folders |
cd | cd | Change directory |
mkdir | mkdir | Create a new folder |
Clear, Ctrl+L, Reset | cls | Clear screen |
- Microsoft Virtual Academy: Getting Started with PowerShell
- Windows PowerShell in Action by Bruce Payette
- Why Learn PowerShell by The Scripting Guys
- Introduction to PowerShell from Pluralsight
- PowerShell Web Docs: Basic cookbooks
- PowerShell eBook from PowerShell.com
- PowerShell Training and Tutorials from Lynda.com
- PowerShell-related Videos on Channel 9
- Learn PowerShell Video Library from PowerShell.com
- PowerShell Quick Reference Guides by PowerShellMagazine.com
- PowerShell 5 How-To Videos by The Scripting Guys