O'Reilly logo

Learning PowerShell by Jonathan Hassell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7 Creating Simple Scripts

Welcome to Chapter 7 of Learning PowerShell! In this chapter, I am going to get loopy. But before we do that, it’s crucial for us to learn how to put together some simple scripts. Once we have the framework of creating our own scripts down, we can add in some of the more advanced logic that involves loops and conditionals.

Let’s get started!

Introducing Scripts in PowerShell

Scripts in PowerShell are basically just text files with a special filename extension, ps1. To create a script, you would enter a bunch of PowerShell commands in a sequence in a new Notepad file (or you could use any text editor you like), and then save that file as NAME.ps1, where NAME is a friendly description of your script—with no spaces, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required