Data - 35012 - Container Labels for Teams, Groups, and Sites#895
Data - 35012 - Container Labels for Teams, Groups, and Sites#895aahmed-spec wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
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.
alexandair
left a comment
There was a problem hiding this comment.
@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%" |
There was a problem hiding this comment.
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.
No description provided.