Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ISE完整窗口中运行Powershell脚本_Powershell_Scheduled Tasks - Fatal编程技术网

在ISE完整窗口中运行Powershell脚本

在ISE完整窗口中运行Powershell脚本,powershell,scheduled-tasks,Powershell,Scheduled Tasks,是否存在从计划程序启动Powershell脚本并运行完整ISE窗口并在完成后关闭的was。 我正在使用ZeedDrive映射SharePoint驱动器,但在Scheduler中运行脚本时,它无法看到该驱动器。然而,如果我在ISE中打开并运行,它会发现它很好。我从ThinkScape得到的信息: 'Zee Drive需要在Windows会话中运行。它是为最终用户设计的–如果它作为服务运行,或“无头”,即没有Windows会话,或从其他Windows会话访问,它将无法工作。 我们不支持Zee Dri

是否存在从计划程序启动Powershell脚本并运行完整ISE窗口并在完成后关闭的was。 我正在使用ZeedDrive映射SharePoint驱动器,但在Scheduler中运行脚本时,它无法看到该驱动器。然而,如果我在ISE中打开并运行,它会发现它很好。我从ThinkScape得到的信息:

'Zee Drive需要在Windows会话中运行。它是为最终用户设计的–如果它作为服务运行,或“无头”,即没有Windows会话,或从其他Windows会话访问,它将无法工作。 我们不支持Zee Drive作为服务运行,也不支持服务类型的工作负载—它是为处理文档的最终用户设计的

任何帮助都将不胜感激。
谢谢

我能想到的唯一方法是将脚本添加到Microsoft.PowerShellISE_profile.ps1中,然后以调度程序和文件作为参数启动ISE,如下所示:

powershell_ise .\Check-Process.ps1
在配置文件中,您希望确保脚本仅在打开该文件时运行:

if($psISE.PowerShellTabs.Files.FullPath -eq '\\fileserver\path$\to\my\Powershell\Check-Process.ps1')
{
    & '\\fileserver\path$\to\my\Powershell\Check-Process.ps1'
}
但是要小心!现在,每次在ISE中打开脚本时,脚本都会运行,除非使用开关
-noprofile


到目前为止,我还没有找到用配置文件脚本关闭ISE窗口的方法。

我能想到的唯一方法是将脚本添加到Microsoft.PowerShellISE_profile.ps1中,然后以调度程序和文件作为参数启动ISE,如下所示:

powershell_ise .\Check-Process.ps1
在配置文件中,您希望确保脚本仅在打开该文件时运行:

if($psISE.PowerShellTabs.Files.FullPath -eq '\\fileserver\path$\to\my\Powershell\Check-Process.ps1')
{
    & '\\fileserver\path$\to\my\Powershell\Check-Process.ps1'
}
但是要小心!现在,每次在ISE中打开脚本时,脚本都会运行,除非使用开关
-noprofile


到目前为止,我还没有找到使用配置文件脚本关闭ISE窗口的方法。

是否尝试将凭据添加到计划程序?是否尝试将凭据添加到计划程序?