O'Reilly logo

Windows PowerShell™ 3.0 Step by Step by Ed Wilson

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

Creating multiple folders: step-by-step exercises

In this exercise, you’ll explore the use of constants, variables, concatenation, decision-making, and looping as you create 10 folders in the C:\Mytest directory. This directory was created earlier. If you do not have this folder on your machine, you can either create it manually or modify the following two exercises to use a folder that exists on your machine. In the second exercise in this section, you will modify the script to delete the 10 folders.

Creating multiple folders via PowerShell scripting

  1. Open the Windows PowerShell ISE.

  2. Create a variable called $intFolders and have it hold the value 10. The code to do this is shown here:

    $intFolders = 10
  3. Create a variable called $intPad. Do not ...

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