How to Run a PowerShell Script from CMD (With Parameters)
To run a PowerShell script from cmd, type powershell with -File and the script path, then any parameters: Swap powershell for pwsh to use PowerShell 7. I ran every command below in a real Command Prompt window, and the two versions don’t always agree on paths, switches and exit codes. Run a PowerShell script from … Read more