Object reference not set to an instance of an object.
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- powershell
- 領域
- devtools
研究方向
首先使用報告中的 PowerShell 模組和 PSScriptAnalyzer 1.21.0 重現 null 參考錯誤,並比較一般的 Invoke-ScriptAnalyzer 執行與帶有 -Verbose 的執行。使用報告中列出的模組和建置工具版本,將故障範圍縮小到特定函式或分析器操作;完成的標準是找出原因並防止例外發生,且不要求詳細輸出。
由索引模型根據 Issue 內容生成。
描述
Good morning,
I have a PowerShell module at work with almost 400 functions. Recently I switched from PSScriptAnalyzer version 1.13.0 to version 1.21.0, fixed a lot of problems, but I have one left. On random functions I get the error:
Exception: Object reference not set to an instance of an object.
If I use the Invoke-ScriptAnalyzer function with the -Verbose switch, the error does not occur. I discovered this by accident while looking for which function is causing the error.
Please advise how to trace the cause.
Somewhere I found information that this can be caused by the Export-ModuleMember function, but I don't want to get rid of it because I would have to fiddle with building the manifest file and that's how Psake does it for me.
For building and checking a powershell module I use
TeamCity and
Psake = '4.9.0'
Pester = '5.3.3'
BuildHelpers = '2.0.16'
PSScriptAnalyzer = '1.21.0'
PSDepend = '0.3.8'

- 主要語言
- C#
- 星號
- 2.2k
- 分支
- 415
- 平均合併
- 13 小時 1 分鐘
- 30 天內合併 PR
- 2
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
PowerShell/PSScriptAnalyzer 的其他 Issue
-
Up-for-Grabs
難度 1/5 1-3 小時 新手友好度 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 48/100
PowerShell/PSScriptAnalyzer#2220 ·
-
難度 3/5 1-2 天 新手友好度 55/100
PowerShell/PSScriptAnalyzer#2219 ·
-
難度 3/5 1-2 天 新手友好度 72/100
PowerShell/PSScriptAnalyzer#2218 ·
-
難度 3/5 1-2 天 新手友好度 72/100
PowerShell/PSScriptAnalyzer#2217 · 1 則留言 ·
查看 PowerShell/PSScriptAnalyzer 的全部 Issue
相似的 Issue
-
go 🏃 testing 🧪
難度 2/5 1-3 小時 新手友好度 78/100
valkey-io/valkey-glide#7239 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
SubtitleEdit/subtitleedit#15462 ·
維護者通常 1 天內回覆
-
:watch: Not Triaged
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
comp:instrumentation.aspnetcore
難度 2/5 1-3 小時 新手友好度 72/100
open-telemetry/opentelemetry-dotnet-contrib#5427 ·
維護者通常 1 天內回覆
-
enhancement needs-triage pkg:OpenTelemetry
難度 2/5 1-3 小時 新手友好度 68/100
open-telemetry/opentelemetry-dotnet#7851 · 4 則留言 ·
維護者通常 1 天內回覆