Conversation
merill
left a comment
There was a problem hiding this comment.
You can write this as one sql query instead of two to improve performance. Do a union and pick the first one.
@merill I’ve updated the code to use a single SQL query with a UNION, as suggested. |
There was a problem hiding this comment.
Pull request overview
This PR adds a new helper function Get-ApplicationNameFromId to resolve application GUIDs to their display names by querying the database. The function is intended to support test assessment 25377, though no test file for that ID exists yet in the repository.
Changes:
- Added new shared helper function that accepts an array of targets (GUIDs or strings) and resolves GUIDs to application display names from ServicePrincipal and Application database objects
- Implements GUID validation before database lookup and falls back to returning the original value if resolution fails
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
src/powershell/private/tests-shared/Get-ApplicationNameFromId.ps1
Outdated
Show resolved
Hide resolved
alexandair
left a comment
There was a problem hiding this comment.
@ashwinikarke has tested with refactored version of the helper function and approved it.
LGTM
No description provided.