首页 > 解决方案 > PowerShell ScheduledJob 运行但不保存输出或返回数据

问题描述

我有一个每天运行以清除缓存的 PowerShell 计划作业。该作业在环境中除一个以外的所有工作站上运行并成功完成。作业运行并清除缓存,但不将输出返回到 Users\User1\AppData\Local\Microsoft\Windows\PowerShell\ScheduledJobs\DailyClearCache\Output。此外,get-job 不会返回任何内容。

任何帮助深表感谢。

Windows 10 PowerShell 5

[computer1]: PS C:\> Get-ScheduledJob

Id         Name            JobTriggers     Command                  Enabled                                                                         
--         ----            -----------     -------                  -------
1          DailyClearCache 1               C:\DailyClearCache.ps1   True   

[computer1]: PS C:\> Get-Job
[computer1]: PS C:\>

标签: powershell

解决方案


推荐阅读