[Schedule Task]Schedule powershell

MSFT相關
回覆文章
schumi
Site Admin
文章: 696
註冊時間: 2004-04-15 14:30:34

[Schedule Task]Schedule powershell

文章 schumi »

https://community.spiceworks.com/how_to ... -scheduler

Action: Start a program
Program/script: Powershell.exe

First you need to set the ExecutionPolicy. You have two options here, you can set the ExecutionPolicy on the machine or you can do it on a per-script basis. Read the PowerShell ExecutionPolicy link below as it talks about or you can issue the command:

Get-Help About_execution_policies

To set the execution policy globally, you can issue this command from within PowerShell:

Set-ExecutionPolicy Unrestricted

Or use one of the other settings available depending on your environment. In the context of this how-to, however, we want to set the execution policy on a per script basis and open up security for us to run the script. This security policy will only be in effect for the script we are running and not compromise security otherwise.

That means we use the following Argument:

-ExecutionPolicy Bypass
回覆文章

回到「Microsoft」