Auto run of PS Script

Hi Team,
Need an assistance for auto executing PowerShell script (ps1). I know that for security reason PS scripts are not run automatically, but yet if you find any way out please guide me.
I tried using batch file, but it’s failed actually. The batch file opening the prompt of PowerShell but after that nothing executed. I’m planning for creating a schedule task, but yet feeling that will not work.
So if any of you find any tricks for the same, please let me know.
Thanks in Advance.

That’s actually not a Powershell scripting issue. :wink: To run a Powershell script you should use a proper command line:

Powershell.exe -ExecutionPolicy Bypass -NoProfile -File “.ps1”

Thanks, it works.

Alternately, you can elect to change the execution policy to permit scripts to run.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser