cBrandon Community

General Category => Windows Fixes => Topic started by: branx86 on August 21, 2018, 02:56:57 PM

Title: Run a PowerShell script from a batch file
Post by: branx86 on August 21, 2018, 02:56:57 PM

You need the -ExecutionPolicy parameter:

Powershell.exe -executionpolicy remotesigned -File  C:\Users\SE\Desktop\ps.ps1

Otherwise PowerShell considers the arguments a line to execute and while Set-ExecutionPolicy is a cmdlet, it has no -File parameter.