[POC] Testing powershell formatting - Work in Progress
Description This is a small POC PR which introduces using .psmx1 formating file to improve console display for our commands. It defines a table view by default, that shows the most common user properties (Display Name, ID, and Description) when working with User objects returned by "Microsoft.EntraBeta.Users" commands.
Changes
Added Users.format.ps1xml with table view definition Modified relevant functions to apply custom type name to returned objects
Testing
Verified format is applied correctly to objects from Get-EntraBetaUser, Get-EntraBetaUserSponsor command Tested in PowerShell 5.1 and PowerShell 7.3 Confirmed format works in both console and ISE
Implementation Details The format file uses a custom type name approach with:
EntraBeta.Users type applied to user objects
Formatting Strategy Approach.
Group related Objects with similar properties.
For example, under the ‘Microsoft.Entra.Beta.Users’ module, different commands such as Get-EntraBetaUser, Get-EntraBetaUserSponsor, Get-EntraBetaDeletedUser return different objects which share similar properties like Id, Name, Description. We can group these related objects by inserting a similar custom type name to each of the command response, For example:
$object.PSTypeNames.Insert(0, "EntraBeta.UserSponsor.Users")
This technique allows us to create a custom format file which targets functions which return different response objects but still share similar properties.
How to load custom formart:
Update-FormatData -AppendPath (Join-Path $PSScriptRoot "Users.format.ps1xml")
Learn Build status updates of commit 676044d:
:white_check_mark: Validation status: passed
| File | Status | Preview URL | Details |
|---|---|---|---|
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUser.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUserSponsor.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Users.format.ps1xml | :white_check_mark:Succeeded |
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 8f48182:
:white_check_mark: Validation status: passed
| File | Status | Preview URL | Details |
|---|---|---|---|
| module/Entra/Microsoft.Entra/Users/Users.format.ps1xml | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUser.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUserSponsor.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Users.format.ps1xml | :white_check_mark:Succeeded | ||
| src/EntraModuleBuilder.ps1 | :white_check_mark:Succeeded |
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit b54f788:
:white_check_mark: Validation status: passed
| File | Status | Preview URL | Details |
|---|---|---|---|
| module/Entra/Microsoft.Entra/Users/Users.format.ps1xml | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUser.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUserSponsor.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Users.format.ps1xml | :white_check_mark:Succeeded | ||
| src/EntraModuleBuilder.ps1 | :white_check_mark:Succeeded |
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 599b14f:
:white_check_mark: Validation status: passed
| File | Status | Preview URL | Details |
|---|---|---|---|
| module/Entra/Microsoft.Entra/Users/Get-EntraUserSponsor.ps1 | :white_check_mark:Succeeded | ||
| module/Entra/Microsoft.Entra/Users/Users.format.ps1xml | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Applications/ApplicationsBeta.format.ps1xml | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Applications/Get-EntraBetaApplicationProxyConnector.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUser.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUserManager.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUserOwnedObject.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/Get-EntraBetaUserSponsor.ps1 | :white_check_mark:Succeeded | ||
| module/EntraBeta/Microsoft.Entra.Beta/Users/UsersBeta.format.ps1xml | :white_check_mark:Succeeded | ||
| src/EntraModuleBuilder.ps1 | :white_check_mark:Succeeded |
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 3aef5af:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 4bcab4a:
:x: Validation status: errors
Please follow instructions here which may help to resolve issue.
| File | Status | Preview URL | Details |
|---|---|---|---|
| :x:Error | Details |
- Line 0, Column 0: [Error: download-failed]
Download failed for file 'https://opdhsblobprod04.blob.core.windows.net/contents/4da76285517d424e9edd429dfb0f9a9d/69602807c7186ed7ee3a91b875771d00'. Try closing and reopening the PR. If you get this Error again, file an issue.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit c15bc5f:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 82130d5:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 80499c4:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 19f29db:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit a7b6d0e:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 4781552:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit a32b193:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit a5a0220:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit 7166412:
:white_check_mark: Validation status: passed
For more details, please refer to the build report.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel