Skip to content

Update logic for AS04 check in EIDSCA and format of cmdlet header#1584

Merged
merill merged 4 commits intomainfrom
tnh-EidscaAs04
Apr 13, 2026
Merged

Update logic for AS04 check in EIDSCA and format of cmdlet header#1584
merill merged 4 commits intomainfrom
tnh-EidscaAs04

Conversation

@Cloud-Architekt
Copy link
Copy Markdown
Collaborator

@Cloud-Architekt Cloud-Architekt commented Apr 3, 2026

  • Updated function definitions in multiple scripts to remove hidden characters.
  • Improved documentation formatting in the @templateps1.txt and various test scripts.
  • Adjusted logic in Test-MtEidscaAS04.ps1 to use select-object for unique values.
  • Fix on regex match for MITRE

Description

Contribution Checklist

Before submitting this PR, please confirm you have completed the following:

  • 📖 Read the guidelines for contributing to this repository.
  • 🧪 Ensure the build and unit tests pass by running /powershell/tests/pester.ps1 on your local system.

 

Join us at the Maester repository discussions 💬 or Entra Discord 🧑‍💻 for more help and conversations!

- Updated function definitions in multiple scripts to remove hidden characters.
- Improved documentation formatting in the @templateps1.txt and various test scripts.
- Adjusted logic in Test-MtEidscaAS04.ps1 to use select-object for unique values.
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 3, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 3, 2026

Deploying maester with  Cloudflare Pages  Cloudflare Pages

Latest commit: d516680
Status: ✅  Deploy successful!
Preview URL: https://c8b5699a.maester.pages.dev
Branch Preview URL: https://tnh-eidscaas04.maester.pages.dev

View logs

@Cloud-Architekt
Copy link
Copy Markdown
Collaborator Author

Cloud-Architekt commented Apr 3, 2026

@SamErde: There have been some updates to Update-EidscaTests.ps1  since it was last executed with a couple of differences and changes between the generated tests and the update logic.

  • I’ve adjusted the spacing format in  @templateps1.txt  to align it with the other cmdlets.
  • I encountered issues with the recent change to BeforeAll, which caused some preconditions (e.g.,  $EnabledAuthMethods ) to be missing. Because of that, I reverted it back to BeforeDiscovery.
  • MITRE Mapping description was missing and I've fixed the regex for this.

Several changes which has been made directly in Maester has been updated in the original source of EIDSCA now.

Could you please review the PR and the described changes?

@Cloud-Architekt Cloud-Architekt marked this pull request as ready for review April 3, 2026 14:31
@Cloud-Architekt Cloud-Architekt requested review from a team as code owners April 3, 2026 14:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the EIDSCA test suite and its generator/templates by removing hidden characters from function declarations, adjusting formatting in generated headers/docs, and updating the AS04 check to account for multiple includeTargets values.

Changes:

  • Remove hidden BOM/zero-width characters from many EIDSCA internal test function headers and reformat cmdlet help headers.
  • Update EIDSCA.AS04 logic/docs to treat .includeTargets.isUsableForSignIn as potentially multi-valued (via Select-Object -Unique).
  • Adjust the EIDSCA test-generation script formatting/regexes and update how it emits the BeforeDiscovery block.

Reviewed changes

Copilot reviewed 49 out of 50 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
website/docs/tests/eidsca/EIDSCA.AS04.md Updates AS04 docs “Setting” field to reflect uniqueness handling.
tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 Updates generated EIDSCA Pester tests (discovery + AS04 comment snippet).
powershell/public/eidsca/Test-MtEidscaControl.ps1 Re-formats comment-based help header placement/format.
powershell/internal/eidsca/Test-MtEidscaST09.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaST08.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaPR06.ps1 Removes hidden character + tweaks “not set” detection logic.
powershell/internal/eidsca/Test-MtEidscaPR05.ps1 Removes hidden character + tweaks “not set” detection logic.
powershell/internal/eidsca/Test-MtEidscaPR03.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaPR02.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaPR01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaCR04.ps1 Removes hidden character + tweaks “not set” detection logic.
powershell/internal/eidsca/Test-MtEidscaCR03.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaCR02.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaCR01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaCP04.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaCP03.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaCP01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAV01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAT02.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAT01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAS04.ps1 Updates AS04 logic/docs to use Select-Object -Unique for multi-target values.
powershell/internal/eidsca/Test-MtEidscaAS04.md Updates AS04 markdown “Test script” snippet to reflect uniqueness handling.
powershell/internal/eidsca/Test-MtEidscaAP14.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP10.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP09.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP08.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP07.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP06.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP05.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP04.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAP01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM10.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM09.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM07.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM06.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM04.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM03.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM02.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAM01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAG03.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAG02.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAG01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAF06.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAF05.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAF04.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAF03.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAF02.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/Test-MtEidscaAF01.ps1 Removes hidden character before function keyword.
powershell/internal/eidsca/@templateps1.txt Re-formats template help text indentation (but still contains BOM).
build/eidsca/Update-EidscaTests.ps1 Updates generator formatting, MITRE/title regex, and emitted BeforeDiscovery header.
Comments suppressed due to low confidence (1)

build/eidsca/Update-EidscaTests.ps1:75

  • In GetRecommendedValueMarkdown, the numeric-comparison branch (the StartsWith('>') / StartsWith('<') block) references $RecommendedValue when composing the markdown, but that variable isn’t defined in this function. This causes missing/incorrect markdown for numeric recommended values. Please use the parameter ($RecommendedValueMarkdown) or extract the numeric portion before composing the string.
    if ($RecommendedValueMarkdown -like "@('*,*')") {
        $RecommendedValueMarkdown = $RecommendedValueMarkdown -replace "@\(", "" -replace "\)", ""
        return "$RecommendedValueMarkdown"
    } elseif ($RecommendedValueMarkdown.StartsWith(">") -or $RecommendedValueMarkdown.StartsWith("<")) {
        $RecommendedValueText = (GetCompareOperator($RecommendedValueMarkdown)).Text

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

Comment thread tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 Outdated
Comment thread tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1
Comment thread powershell/internal/eidsca/Test-MtEidscaAS04.ps1
Comment thread powershell/internal/eidsca/Test-MtEidscaAS04.ps1 Outdated
Comment thread powershell/internal/eidsca/Test-MtEidscaAS04.md Outdated
Comment thread build/eidsca/Update-EidscaTests.ps1 Outdated
Comment thread powershell/internal/eidsca/@templateps1.txt Outdated
Comment thread powershell/internal/eidsca/Test-MtEidscaPR05.ps1 Outdated
Comment thread powershell/internal/eidsca/Test-MtEidscaPR06.ps1 Outdated
Comment thread powershell/internal/eidsca/Test-MtEidscaCR04.ps1 Outdated
Comment thread tests/EIDSCA/Test-EIDSCA.Generated.Tests.ps1 Outdated
Fix 1: GetPortalDeepLinkMarkdown - $uri -> $portalDeepLink (Update-EidscaTests.ps1:296)
Fix 2: Add try/catch around discovery block (Update-EidscaTests.ps1:495-502)
Fix 3: Remove BOM from @templateps1.txt
Fix 4: Handle pipeline in %CurrentValue% - template code line (@templateps1.txt:26-28)
Fix 5: Handle pipeline in %CurrentValue% - doc/comment contexts (@template.md, @templateps1.txt, test template)
Fix 6: Remove BOM from @Test-MtEidscaControl.txt
Verify all source file changes are consistent
Regenerate output files by running Update-EidscaTests.ps1
Copy link
Copy Markdown
Contributor

@merill merill left a comment

Choose a reason for hiding this comment

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

LGTM

@merill merill merged commit 47afea3 into main Apr 13, 2026
9 checks passed
@SamErde SamErde deleted the tnh-EidscaAs04 branch April 13, 2026 16:58
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.

4 participants