我是靠谱客的博主 可靠烤鸡,这篇文章主要介绍在windows下运行linux脚本,windows2012R2 计划任务如何运行powershell 脚本,现在分享给大家,希望可以做个参考。

>>windows2012R2 计划任务如何运行powershell 脚本

$Taskname = 'RunPSScriptAt9'

$user = "candyadministrator"

$scriptpath = "\powershellscripttest.ps1"

$trigger = New-ScheduledTaskTrigger -At 9:00am -Daily

$Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-executionpolicy bypass -noprofile -file $scriptpath"

Register-ScheduledTask -TaskName $Taskname -Trigger $trigger -User $user -Action $Action -RunLevel Highest -Force

您可以尝试以上的脚本来新建计划任务来测试是否可以自动周期运行。

此致

Candy

Please remember to mark the replies as answers if they help.

If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

最后

以上就是可靠烤鸡最近收集整理的关于在windows下运行linux脚本,windows2012R2 计划任务如何运行powershell 脚本的全部内容,更多相关在windows下运行linux脚本,windows2012R2内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(83)

评论列表共有 0 条评论

立即
投稿
返回
顶部