Skip to content

Fix up LDAP parser errors - #101

Merged
jborean93 merged 2 commits into
mainfrom
parse-error
May 7, 2026
Merged

Fix up LDAP parser errors#101
jborean93 merged 2 commits into
mainfrom
parse-error

Conversation

@jborean93

Copy link
Copy Markdown
Owner

A change in PowerShell 7.4 broke the logic the parser error was using to display the filter offset being displayed on a parser error. This uses a newer API to bring back a better error message for existing PowerShell versions as well as support for an even better API used in PowerSHell 7.7+.

A change in PowerShell 7.4 broke the logic the parser error was using to
display the filter offset being displayed on a parser error. This uses a
newer API to bring back a better error message for existing PowerShell
versions as well as support for an even better API used in PowerSHell
7.7+.
@jborean93
jborean93 requested a review from Copilot May 7, 2026 05:42
@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.48%. Comparing base (1a50ff1) to head (63ae5cb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   74.70%   80.48%   +5.78%     
==========================================
  Files          63       63              
  Lines        7069     7549     +480     
  Branches      903      901       -2     
==========================================
+ Hits         5281     6076     +795     
+ Misses       1604     1276     -328     
- Partials      184      197      +13     
Flag Coverage Δ
Linux_74_MIT 80.22% <100.00%> (+5.69%) ⬆️
Linux_75_MIT 80.22% <100.00%> (+5.69%) ⬆️
Linux_76_Heimdal 80.31% <100.00%> (+5.67%) ⬆️
Linux_76_MIT 80.22% <100.00%> (+5.69%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Restores richer LDAP filter parse error positioning after PowerShell 7.4 formatter changes by switching away from reflection-based InvocationInfo manipulation and adding a regression test + changelog note.

Changes:

  • Replace reflection-based _invocationInfo setting with a TargetObject hashtable carrying line/column position metadata.
  • Add a Pester test asserting ParserError and positional metadata for invalid -LDAPFilter.
  • Document the behavior change/requirements in the changelog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/Get-OpenADObject.Tests.ps1 Adds coverage asserting parser error category + positional metadata on invalid LDAP filters.
src/PSOpenAD.Module/Commands/GetOpenAD.cs Switches parser error formatting to PowerShell’s newer formatting expectations via TargetObject metadata.
CHANGELOG.md Notes the improved parse error location output and PS 7.7+ column support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PSOpenAD.Module/Commands/GetOpenAD.cs Outdated
Comment thread src/PSOpenAD.Module/Commands/GetOpenAD.cs Outdated
Comment thread CHANGELOG.md Outdated
@jborean93
jborean93 merged commit 0cadd7a into main May 7, 2026
6 checks passed
@jborean93
jborean93 deleted the parse-error branch May 7, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants