I have a batch file that is calling a PowerShell script. The PowerShell script performs various tasks before and after adding a computer to the domain. After the machine is added to the domain, Group Policy sets the execution policy to "RemoteSigned." I have not had an issue using the "ExecutionPolicy -bypass" switch when opening a PowerShell script in the past. Why does PowerShell think the script is a remote script after adding the machine to the domain? Is there something I need to change or add to the batch file?
Ah – Turns out the user that was getting this error copied the script to their home drive and THEN to a USB drive, which blocked the file. I think Unblock-File works in this instance, but don't think this will be an issue in the future since the file won't be copied that way...
The topic ‘Execution Policy Issue - ExecutionPolicy -bypass not working’ is closed to new replies.