Running PowerShell scripts

It is now time to run your script. In the following sections, we will see how you can run your PowerShell scripts through the command shell or the Integrated Scripting Environment (ISE).

Through shell or through the ISE

You can run ad hoc commands using the shell or the Integrated Scripting Environment (ISE).

Depending on your operating system, you may have a different navigation path to open the PowerShell console. An easy way is to use Windows Search to look for Windows PowerShell. Often, when managing your servers or performing administrative tasks, you will need to run PowerShell as an administrator. To do this, right-click on PowerShell and select Run as administrator.

Once the console is ready, you can type your commands ...

Get SQL Server 2014 with PowerShell v5 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.