-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Labels
Description
Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:
- Make sure you can reproduce this issue using the latest released version of
Microsoft.Graph.EntraorMicrosoft.Graph.Entra.Beta. - Please search the existing issues to see if there has been a similar issue filed.
Describe the bug
Several commands in the Microsoft.Graph.Entra module have incomplete or insufficient examples in their Help synopsis.
To Reproduce
Steps to reproduce the behavior:
- Run the following PowerShell command:
Get-Help <Command-Name> -Examples- Observe that the returned examples are either missing or incomplete.
Expected behavior
The Get-Help command should return proper, fully fleshed-out examples that demonstrate typical use cases for the specified command.
Debug Output
The following commands have issues with the examples:
First
Get-Help Add-EntraDeviceRegisteredOwner -Examples- Issue: It shows the wrong command name in Example 1
NAME
Add-EntraDeviceRegisteredOwner
SYNOPSIS
Adds a registered owner for a device.
---------- Example 1: Add a user as a registered user ----------
Connect-Entra -Scopes 'Device.ReadWrite.All'
$User = Get-EntraUser -ObjectId 'SawyerM@contoso.com'
$Device = Get-EntraDevice -SearchString '<device-display-name>'
$params = @{
ObjectId = $Device.ObjectId
RefObjectId = $User.ObjectId
}
Add-EntraDeviceRegisteredUser @params
This example shows how to add a registered user to a device.
- `-ObjectId` parameter specifies the unique identifier (Object ID) of the device to which you want to add a registered user. The $Device.ObjectId variable should contain the Object ID of the device. You can use the command `Get-EntraDevice` to get device Id.
- `-RefObjectId` parameter specifies the unique identifier (Object ID) of the user who will be added as a registered user of the device. The $User.ObjectId variable should contain the Object ID of the user. You can use the command `Get-EntraUser` to get user Id.
Second
Get-Help Remove-EntraDeviceRegisteredUser -Examples- Issue: It shows the wrong command name in Example 1
NAME
Remove-EntraDeviceRegisteredUser
SYNOPSIS
Removes a registered user from a device.
------ Example 1: Remove a registered user from a device ------
Connect-Entra -Scopes 'Directory.AccessAsUser.All'
$Device = Get-EntraDevice -Top 1
$User = Get-EntraDeviceRegisteredUser -ObjectId $Device.ObjectId
Remove-EntraDeviceRegisteredOwner -ObjectId $Device.ObjectId -OwnerId $Owner.ObjectId
This example shows how to remove the registered user from device.Third
Get-Help Get-EntraUnsupportedCommand -Examples- Issue: It lacks any proper examples
NAME
Get-EntraUnsupportedCommand
SYNOPSIS
{{ Fill in the Synopsis }}
-------------------------- Example 1 --------------------------
PS C:\> {{ Add example code here }}
{{ Add example description here }}
Fourth
Get-Help Set-EntraIdentityProvider -Examples- Issue: 2nd Example has the command misspelled
NAME
Set-EntraIdentityProvider
SYNOPSIS
Update the properties of an existing identity provider configured in the directory.
--- Example 2: Update client secret of an identity provider ---
Connect-Entra -Scopes 'IdentityProvider.ReadWrite.All'
$params = @{
Id = 'Google-OAuth'
ClientSecret = 'NewClientSecret'
}
Set-EntradentityProvider @params
This example updates the client secret for the specified identity provider.
- `-Id` parameter specifies the unique identifier of the identity provider.
- `-ClientSecret` parameter specifies the client secret for the application, obtained during registration with the identity provider.
Module Version
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 0.16.0 preview Microsoft.graph.Entra {Add-EntraAdministrativeUnitMember, Add-EntraAppli
Environment Data
Name Value
---- -----
PSVersion 7.4.5
PSEdition Core
GitCommitId 7.4.5
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
To extract that information I have used my Module: PSModuleAnalyzer