Skip to content

Data - 35012 - Container Labels for Teams, Groups, and Sites#895

Open
aahmed-spec wants to merge 5 commits intomainfrom
test-35012-bugfix
Open

Data - 35012 - Container Labels for Teams, Groups, and Sites#895
aahmed-spec wants to merge 5 commits intomainfrom
test-35012-bugfix

Conversation

@aahmed-spec
Copy link
Collaborator

No description provided.

@aahmed-spec aahmed-spec self-assigned this Feb 13, 2026
@aahmed-spec aahmed-spec marked this pull request as ready for review February 13, 2026 07:06
@alexandair alexandair requested a review from Copilot February 13, 2026 07:12
Copy link
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 pull request refactors Test-Assessment.35012 to simplify how container labels for Teams, Groups, and Sites are identified. Instead of parsing the LabelActions JSON to detect protectgroup and protectsite actions, the test now directly examines the ContentType property for Site and UnifiedGroup scopes.

Changes:

  • Simplified container label detection by checking ContentType property directly instead of parsing LabelActions JSON
  • Updated the label summary to display label metadata (DisplayName, IsParent, Priority) instead of protection settings
  • Updated documentation URL to reflect Microsoft's documentation restructuring

Reviewed changes

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

File Description
src/powershell/tests/Test-Assessment.35012.ps1 Refactored Get-ContainerLabelSummary to return label metadata; simplified Test-ContainerLabel to check ContentType for Site and UnifiedGroup scopes; removed JSON parsing error handling; updated markdown table columns
src/powershell/tests/Test-Assessment.35012.md Updated Microsoft Learn documentation URL from /purview/ to /microsoft-365/compliance/ path

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

@aahmed-spec aahmed-spec added the ready for review PR is ready for review and merging label Feb 13, 2026
Copy link
Collaborator

@alexandair alexandair left a comment

Choose a reason for hiding this comment

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

@aahmed-spec Please, address my feedback.

I've also added 2 commits.
To split on comma followed by zero or more whitespace characters.
To have explicit left alignment in Markdown tables.


$customStatus = 'Investigate'
$testResultMarkdown =
"⚠️ Query fails or LabelActions JSON cannot be parsed due to permissions issues or service connection failure. Ensure the Security & Compliance PowerShell module is connected and the account has appropriate permissions to retrieve label properties.`n`n%TestResult%"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The script sets an error message but still appends %TestResult%. This token is later replaced by $mdInfo, which generates a Summary table. Since the query failed, $allLabels is null, causing the table to display "Total sensitivity labels | 0". This misleadingly suggests an empty environment rather than a connectivity error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready for review and merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants