Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Invoke-IcingaCheckScheduledTask works directly but fails via Exit-IcingaExecutePlugin when using -TaskPath array

未关闭
#475 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
powershell
领域
cli

调研方向

使用相同的 -TaskPath 数组重现直接的 Invoke-IcingaCheckScheduledTask 命令和 Exit-IcingaExecutePlugin wrapper 命令。首先比较 Exit-IcingaExecutePlugin 如何将 -TaskPath 传递给 Invoke-IcingaCheckScheduledTask。完成的标准是 wrapper 返回经过筛选的 \Icinga\ 任务,将 checks 添加到 package 中,并以代码 0 退出。

由索引模型根据 Issue 内容生成。

描述

Hi team,

I found a reproducible issue with Invoke-IcingaCheckScheduledTask when called through Exit-IcingaExecutePlugin.

Environment

icinga-powershell-framework: 1.14.2
icinga-powershell-plugins: 1.14.1
Windows Server (PowerShell 5.1)
Icinga 2 command path uses the standard wrapper (PowerShell Base + Exit-IcingaExecutePlugin)
What works (direct invocation)

PS C:\Windows\system32> & 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "Invoke-IcingaCheckScheduledTask -TaskPath @('\Icinga*') -Verbosity 3"

[INFO] Scheduled Tasks (All must be [OK])
_ [INFO] \Icinga\Icinga for Windows\ (All must be [OK])
_ [INFO] Renew Certificate (All must be [OK])
_ [INFO] Last Run Time [2026/04/23 10:26:26]: 1.82h
_ [INFO] Last Task Result: 0
_ [INFO] Missed Runs: 0
_ [INFO] Next Run Time [2026/04/24 01:00:00]: -12.74h
_ [INFO] State: Ready
_ [INFO] Set Process Priority (All must be [OK])
_ [INFO] Last Run Time [2026/04/23 10:27:27]: 1.81h
_ [INFO] Last Task Result: 0
_ [INFO] Missed Runs: 0
_ [INFO] Next Run Time [Never]: Never
_ [INFO] State: Ready
| icinga_icingaforwindows_renewcertificate::ifw_scheduledtask::lastruntime=6565s;;;; icinga_icingaforwindows_renewcertificate::ifw_scheduledtask::lasttaskresult=0;;;; icinga_icingaforwindows_renewcertificate::ifw_scheduledtask::missedruns=0;;;; icinga_icingaforwindows_renewcertificate::ifw_scheduledtask::nextruntime=-45849s;;;; icinga_icingaforwindows_renewcertificate::ifw_scheduledtask::state=3;;;; icinga_icingaforwindows_setprocesspriority::ifw_scheduledtask::lastruntime=6505s;;;; icinga_icingaforwindows_setprocesspriority::ifw_scheduledtask::lasttaskresult=0;;;; icinga_icingaforwindows_setprocesspriority::ifw_scheduledtask::missedruns=0;;;; icinga_icingaforwindows_setprocesspriority::ifw_scheduledtask::nextruntime=0s;;;; icinga_icingaforwindows_setprocesspriority::ifw_scheduledtask::state=3;;;;
0

Expected tasks are returned (e.g. \Icinga\Icinga for Windows...)
Exit code: 0

What fails (wrapper invocation)

PS C:\Windows\system32> & 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'   -NoProfile -NoLogo -ExecutionPolicy Bypass   -Command "try { Use-Icinga -Minimal } catch { Write-Output 'Framework not loaded'; Write-Output $($_.Exception.Message); exit 3 }; Exit-IcingaExecutePlugin -Command 'invoke-icingacheckscheduledtask' -TaskPath @('\Icinga*') -Verbosity 3"

[INFO] Scheduled Tasks: No checks added to this package (All must be [OK])
|

Exit code: 3

Expected behavior
Wrapper invocation via Exit-IcingaExecutePlugin should behave identically to direct invocation and return the same filtered scheduled tasks for -TaskPath @('\Icinga*').

Actual behavior
Only the wrapper path fails (empty package / no checks added), while direct invocation works with the same arguments.

Notes

This is reproducible consistently on the same host/session.
The issue appears specific to the wrapper argument handling path, not the plugin function itself.
Thanks for taking a look.

主要语言
PowerShell
星标
55
派生
31
平均合并
4 天 5 小时
30 天内合并 PR
6

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Icinga/icinga-powershell-plugins 的其他 Issue

查看 Icinga/icinga-powershell-plugins 的全部 Issue

相似的 Issue

更多 CLI Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。