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.
More Related Contents:
- Is there a way to find the length of a string in Batch/PowerShell Script/VBScript? [closed]
- Batch file v PowerShell script
- Parallel execution of shell processes
- How to run a PowerShell script without displaying a window?
- FORFILES date -after- (date calc in cmd file)
- What is the proper way to test if a parameter is empty in a batch file?
- How to run a PowerShell script within a Windows batch file
- Convert a small PS script into a long line in a .BATch file
- Windows batch: sleep [duplicate]
- Can I send some text to the STDIN of an active process under Windows?
- Several ways to call a windows batch file from another one or from prompt. Which one in which case?
- How can I source variables from a .bat file into a PowerShell script?
- How to expand a CMD shell variable twice (recursively)
- How do I run two commands in one line in Windows CMD?
- $LastExitCode=0, but $?=False in PowerShell. Redirecting stderr to stdout gives NativeCommandError
- Windows batch file file download from a URL
- How to run batch file from network share without “UNC path are not supported” message?
- How to split a string by spaces in a Windows batch file?
- How can two text files be read in parallel by a batch file?
- Setting a windows batch file variable to the day of the week
- Unix tail equivalent command in Windows Powershell
- Capture program stdout and stderr to separate variables
- Curl not recognized as an internal or external command, operable program or batch file
- Why %processor_architecture% always returns x86 instead of AMD64
- Why is the FOR /f loop in this batch script evaluating a blank line?
- How to check if a directory exists in %PATH%
- batch file Copy files with certain extensions from multiple directories into one directory
- Path prefixes \??\ and \\?\
- Windows console %DATE% Math
- Out of a git console: how do I execute a batch file and then return to git console?