Powershell 任务计划程序卡在运行中 [英] Powershell Task Scheduler Stuck Running
问题描述
我试图用任务调度程序测试一个简单的 powershell 脚本,状态显示为 running 但 powershell 控制台从未出现.
我的 ps1 脚本只包含两个简单的命令:
- 目录
- 暂停
这是我的设置:
一般
- 运行用户是否登录(检查)
- 以最高权限运行(勾选)
操作
- 操作:启动程序
- 程序/脚本:C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
- 添加参数(可选):-file E:\iQ_Schedule\Untitled1.ps1
此设置适用于其他计算机(Windows 10),但不适用于此计算机(Windows Server 2012 R2).我不知道为什么.
欢迎使用
正在运行的任务是会话 0 对显示用户界面有限制
I was trying to test a simple powershell script with task scheduler, the status showed running but the powershell console never showed up.
My ps1 script just contains two simple commands:
- dir
- pause
Here is my setup:
General
- Run whether user is logged on or not (check)
- Run with highest privileges (check)
Actions
- Action: Start a program
- Program/Script: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
- Add arguments (optional): -file E:\iQ_Schedule\Untitled1.ps1
This setup works on other computer (Windows 10) but just won't on this one (Windows Server 2012 R2). I am not sure why.
Welcome to Session 0 isolation mode.
When you run your task with "Run whether user logged in or not", it runs in so called session 0. You can check this with your task manager.
Tasks running is Session 0 has restrictions on showing the user interface
这篇关于Powershell 任务计划程序卡在运行中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!