Table of Contents
- Introduction
- Running PowerShell from the old Command Prompt
- Running PowerShell from a PowerShell Script
- Running a PowerShell Script by Clicking the Icon
- Running a PowerShell Script via a PowerShell Window
- Running a PowerShell Script via Command Prompt
- Running a PowerShell Script from Another PowerShell Script
- Running a PowerShell Script or Command from a Batch Script
- Using PowerShell with Task Scheduler
- Using a Scheduled Task with powershell.exe to Execute PowerShell Code
- Using a Scheduled Task with a Batch Script to Execute PowerShell Code
- Conclusion
Introduction
Using PowerShell on the command line is not the only way to use PowerShell.
You can write PowerShell scripts. You can run PowerShell from the old Command Prompt. You can run PowerShell from batch scripts, other PowerShell scripts, scheduled tasks, etc.
Running PowerShell from the old Command Prompt
First, lets look at the difference between running PowerShell from the PowerShell command line interface (powershell.exe) vs running PowerShell from the old Command Prompt (cmd.exe).
To run PowerShell commands from within powershell.exe, you just use the language as usual: