From 0285651b8d7d15e04ec7e79d17c2b1774f691d2a Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Tue, 15 Jun 2021 06:41:47 +0300 Subject: [PATCH 1/5] Added examples to the cmdlets --- .../v1.0/New-MgUserAppRoleAssignment.md | 30 +++++++++++-------- .../v1.0/Remove-MgGroupAppRoleAssignment.md | 18 ++++------- .../examples/v1.0/Update-MgApplication.md | 13 ++++---- .../Groups/examples/v1.0/Get-MgGroupOwner.md | 21 +++++-------- .../v1.0/Get-MgDirectoryRoleMember.md | 25 ++++++++-------- 5 files changed, 49 insertions(+), 58 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md index 093355d11d5..fc9ef18f91c 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md @@ -1,18 +1,22 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Assign a user an application role -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ` + -PrincipalId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ` + -ResourceId '0873169c-9595-4664-9d02-499b49846ff1' ` + -AppRoleID '00000000-0000-0000-0000-000000000000' | + Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName, + PrincipalId, PrincipalType, ResourceDisplayName, ResourceId ``` -{{ Add description here }} +```Output +Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI +AppRoleId : 00000000-0000-0000-0000-000000000000 +PrincipalDisplayName : Adele Vance +PrincipalId : 8a7c50d3-fcbd-4727-a889-8ab232dfea01 +PrincipalType : User +ResourceDisplayName : dxprovisioning-analytics +ResourceId : 0873169c-9595-4664-9d02-499b49846ff1 +``` +This commands assigns the specified user a role in the specified application resource. diff --git a/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md index 093355d11d5..74f1afb199c 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md @@ -1,18 +1,10 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove a user's application role assignment -{{ Add description here }} +This example removes the specified application role from the specified user. -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgUserAppRoleAssignment ` +-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' ` +-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - diff --git a/src/Applications/Applications/examples/v1.0/Update-MgApplication.md b/src/Applications/Applications/examples/v1.0/Update-MgApplication.md index 093355d11d5..6da9310f25b 100644 --- a/src/Applications/Applications/examples/v1.0/Update-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0/Update-MgApplication.md @@ -1,11 +1,12 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} +### Example 1: Update an application -{{ Add output here }} -``` +This example updates the specified application's display name. -{{ Add description here }} +```powershell +Update-MgApplication ` + -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' ` + -DisplayName 'Testing App' +``` ### Example 2: {{ Add title here }} ```powershell diff --git a/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md b/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md index 093355d11d5..9f3f0af10b7 100644 --- a/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md +++ b/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get an owner of a group -{{ Add description here }} +This example gets the owner of the specified group. -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Get-MgGroupOwner -GroupId '4d5f57a1-85e0-41dd-8282-ff995ad5e1c3' ``` -{{ Add description here }} - +```Output +Id DeletedDateTime +-- --------------- +5fc5c052-8774-4258-8705-0b4ab3e9a2df +``` \ No newline at end of file diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md index 093355d11d5..8386392bced 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md @@ -1,18 +1,17 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get member from directory roles -{{ Add description here }} +This example gets the members of a directory role -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Get-MgDirectoryRoleMember -DirectoryRoleId 'c6bb44c1-73cc-48a1-a73c-b6a977084948' ``` -{{ Add description here }} - +```Output +Id DeletedDateTime +-- --------------- +68550c41-18a3-495e-aa1d-cf628c171b48 +f890ceed-822a-4647-8748-73d88013ae9d +5d5dff7a-d9cd-4bd3-a585-3d0ebbd58b69 +5fc5c052-8774-4258-8705-0b4ab3e9a2df +7425a698-2aa8-4333-9352-04f52e3a4c9d +``` \ No newline at end of file From 7fc03f95493bbd0379e2780b2efbe364ea8f1898 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Thu, 17 Jun 2021 06:37:19 +0300 Subject: [PATCH 2/5] Updated the examples to conform to the AutoREST format --- .../v1.0-beta/New-MgUserAppRoleAssignment.md | 28 ++++++++++--------- .../Remove-MgUserAppRoleAssignment.md | 19 ++++--------- .../v1.0-beta/Update-MgApplication.md | 19 ++++--------- .../v1.0/New-MgUserAppRoleAssignment.md | 2 -- .../v1.0/Remove-MgGroupAppRoleAssignment.md | 18 ++++++++---- .../v1.0/Remove-MgUserAppRoleAssignment.md | 19 ++++--------- .../examples/v1.0/Update-MgApplication.md | 12 +------- .../examples/v1.0-beta/Get-MgGroupOwner.md | 19 ++++--------- .../Groups/examples/v1.0/Get-MgGroupOwner.md | 8 ++---- .../v1.0-beta/Get-MgDirectoryRoleMember.md | 25 ++++++++--------- .../v1.0/Get-MgDirectoryRoleMember.md | 8 ++---- 11 files changed, 67 insertions(+), 110 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgUserAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/New-MgUserAppRoleAssignment.md index 093355d11d5..0b50b0d2263 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgUserAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgUserAppRoleAssignment.md @@ -1,18 +1,20 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Assign a user an application role -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ` + -PrincipalId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ` + -ResourceId '0873169c-9595-4664-9d02-499b49846ff1' ` + -AppRoleID '00000000-0000-0000-0000-000000000000' | + Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName, + PrincipalId, PrincipalType, ResourceDisplayName, ResourceId -{{ Add output here }} +Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI +AppRoleId : 00000000-0000-0000-0000-000000000000 +PrincipalDisplayName : Adele Vance +PrincipalId : 8a7c50d3-fcbd-4727-a889-8ab232dfea01 +PrincipalType : User +ResourceDisplayName : dxprovisioning-analytics +ResourceId : 0873169c-9595-4664-9d02-499b49846ff1 ``` -{{ Add description here }} - +This commands assigns the specified user a role in the specified application resource. diff --git a/src/Applications/Applications/examples/v1.0-beta/Remove-MgUserAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0-beta/Remove-MgUserAppRoleAssignment.md index 093355d11d5..2ddb9b5ebf7 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Remove-MgUserAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0-beta/Remove-MgUserAppRoleAssignment.md @@ -1,18 +1,9 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove a user's application role assignment -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgUserAppRoleAssignment ` +-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' ` +-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - +This example removes the specified application role from the specified user. diff --git a/src/Applications/Applications/examples/v1.0-beta/Update-MgApplication.md b/src/Applications/Applications/examples/v1.0-beta/Update-MgApplication.md index 093355d11d5..60e61c5ae2d 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Update-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0-beta/Update-MgApplication.md @@ -1,18 +1,9 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Update an application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Update-MgApplication ` + -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' ` + -DisplayName 'Testing App' ``` -{{ Add description here }} - +This example updates the specified application's display name. diff --git a/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md index fc9ef18f91c..0b50b0d2263 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/New-MgUserAppRoleAssignment.md @@ -7,9 +7,7 @@ New-MgUserAppRoleAssignment -Userid '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ` -AppRoleID '00000000-0000-0000-0000-000000000000' | Format-List Id, AppRoleId, CreationTime, PrincipalDisplayName, PrincipalId, PrincipalType, ResourceDisplayName, ResourceId -``` -```Output Id : 01B8ir38J0eoiYqyMt_qAWev_PSoYDBGmcqI9E2dyKI AppRoleId : 00000000-0000-0000-0000-000000000000 PrincipalDisplayName : Adele Vance diff --git a/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md index 74f1afb199c..093355d11d5 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgGroupAppRoleAssignment.md @@ -1,10 +1,18 @@ -### Example 1: Remove a user's application role assignment +### Example 1: {{ Add title here }} +```powershell +PS C:\> {{ Add code here }} + +{{ Add output here }} +``` -This example removes the specified application role from the specified user. +{{ Add description here }} +### Example 2: {{ Add title here }} ```powershell -Remove-MgUserAppRoleAssignment ` --AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' ` --UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' +PS C:\> {{ Add code here }} + +{{ Add output here }} ``` +{{ Add description here }} + diff --git a/src/Applications/Applications/examples/v1.0/Remove-MgUserAppRoleAssignment.md b/src/Applications/Applications/examples/v1.0/Remove-MgUserAppRoleAssignment.md index 093355d11d5..2ddb9b5ebf7 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgUserAppRoleAssignment.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgUserAppRoleAssignment.md @@ -1,18 +1,9 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Remove a user's application role assignment -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Remove-MgUserAppRoleAssignment ` +-AppRoleAssignmentID '01B8ir38J0eoiYqyMt_qAVDX9vgSB6xDur4zn5zOluM' ` +-UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' ``` -{{ Add description here }} - +This example removes the specified application role from the specified user. diff --git a/src/Applications/Applications/examples/v1.0/Update-MgApplication.md b/src/Applications/Applications/examples/v1.0/Update-MgApplication.md index 6da9310f25b..60e61c5ae2d 100644 --- a/src/Applications/Applications/examples/v1.0/Update-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0/Update-MgApplication.md @@ -1,19 +1,9 @@ ### Example 1: Update an application -This example updates the specified application's display name. - ```powershell Update-MgApplication ` -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' ` -DisplayName 'Testing App' ``` -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} - +This example updates the specified application's display name. diff --git a/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupOwner.md b/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupOwner.md index 093355d11d5..994013cbfe6 100644 --- a/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupOwner.md +++ b/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupOwner.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get an owner of a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgGroupOwner -GroupId '4d5f57a1-85e0-41dd-8282-ff995ad5e1c3' -{{ Add output here }} +Id DeletedDateTime +-- --------------- +5fc5c052-8774-4258-8705-0b4ab3e9a2df ``` -{{ Add description here }} - +This example gets the owner of the specified group. diff --git a/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md b/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md index 9f3f0af10b7..994013cbfe6 100644 --- a/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md +++ b/src/Groups/Groups/examples/v1.0/Get-MgGroupOwner.md @@ -1,13 +1,11 @@ ### Example 1: Get an owner of a group -This example gets the owner of the specified group. - ```powershell Get-MgGroupOwner -GroupId '4d5f57a1-85e0-41dd-8282-ff995ad5e1c3' -``` -```Output Id DeletedDateTime -- --------------- 5fc5c052-8774-4258-8705-0b4ab3e9a2df -``` \ No newline at end of file +``` + +This example gets the owner of the specified group. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleMember.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleMember.md index 093355d11d5..9abc2d13814 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleMember.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleMember.md @@ -1,18 +1,15 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get member from directory roles -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Get-MgDirectoryRoleMember -DirectoryRoleId 'c6bb44c1-73cc-48a1-a73c-b6a977084948' + +Id DeletedDateTime +-- --------------- +68550c41-18a3-495e-aa1d-cf628c171b48 +f890ceed-822a-4647-8748-73d88013ae9d +5d5dff7a-d9cd-4bd3-a585-3d0ebbd58b69 +5fc5c052-8774-4258-8705-0b4ab3e9a2df +7425a698-2aa8-4333-9352-04f52e3a4c9d ``` -{{ Add description here }} - +This example gets the members of a directory role. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md index 8386392bced..9abc2d13814 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleMember.md @@ -1,12 +1,8 @@ ### Example 1: Get member from directory roles -This example gets the members of a directory role - ```powershell Get-MgDirectoryRoleMember -DirectoryRoleId 'c6bb44c1-73cc-48a1-a73c-b6a977084948' -``` -```Output Id DeletedDateTime -- --------------- 68550c41-18a3-495e-aa1d-cf628c171b48 @@ -14,4 +10,6 @@ f890ceed-822a-4647-8748-73d88013ae9d 5d5dff7a-d9cd-4bd3-a585-3d0ebbd58b69 5fc5c052-8774-4258-8705-0b4ab3e9a2df 7425a698-2aa8-4333-9352-04f52e3a4c9d -``` \ No newline at end of file +``` + +This example gets the members of a directory role. From aadcacab7858777fcc3171954f2207d97d2b3441 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Tue, 6 Jul 2021 16:24:01 +0300 Subject: [PATCH 3/5] Added examples for the cmdlets --- .../v1.0-beta/New-MgServicePrincipal.md | 24 ++++++------- .../examples/v1.0/New-MgServicePrincipal.md | 24 ++++++------- .../examples/v1.0-beta/Get-MgContact.md | 20 ++++------- .../examples/v1.0-beta/Get-MgDomain.md | 34 ++++++++++++------- .../New-MgDirectoryRoleMemberByRef.md | 19 ++++------- .../examples/v1.0/Get-MgContact.md | 20 ++++------- .../examples/v1.0/Get-MgDomain.md | 34 ++++++++++++------- .../v1.0/New-MgDirectoryRoleMemberByRef.md | 19 ++++------- 8 files changed, 90 insertions(+), 104 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipal.md b/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipal.md index 093355d11d5..6681c5ad0db 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgServicePrincipal.md @@ -1,18 +1,16 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Create a new service principal object -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$ServicePrincipalID=@{ + "AppId" = "fc876dd1-6bcb-4304-b9b6-18ddf1526b62" + } +New-MgServicePrincipal -BodyParameter $ServicePrincipalId | + Format-List id, DisplayName, AppId, SignInAudience -{{ Add output here }} +Id : ac483a5f-f291-4499-8a62-058547724579 +DisplayName : Example App +AppId : ffdf268a-2fe2-49e1-8cd7-66ecb61641ec +SignInAudience : AzureADandPersonalMicrosoftAccount ``` -{{ Add description here }} - +In this example, the first command defines the service principal object in the variable $ServiceprincipalId. The second command creates a new service principal object. diff --git a/src/Applications/Applications/examples/v1.0/New-MgServicePrincipal.md b/src/Applications/Applications/examples/v1.0/New-MgServicePrincipal.md index 093355d11d5..6681c5ad0db 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0/New-MgServicePrincipal.md @@ -1,18 +1,16 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Create a new service principal object -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$ServicePrincipalID=@{ + "AppId" = "fc876dd1-6bcb-4304-b9b6-18ddf1526b62" + } +New-MgServicePrincipal -BodyParameter $ServicePrincipalId | + Format-List id, DisplayName, AppId, SignInAudience -{{ Add output here }} +Id : ac483a5f-f291-4499-8a62-058547724579 +DisplayName : Example App +AppId : ffdf268a-2fe2-49e1-8cd7-66ecb61641ec +SignInAudience : AzureADandPersonalMicrosoftAccount ``` -{{ Add description here }} - +In this example, the first command defines the service principal object in the variable $ServiceprincipalId. The second command creates a new service principal object. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContact.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContact.md index 093355d11d5..ef0efe55e13 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContact.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContact.md @@ -1,18 +1,12 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Retrieve contact objects in the directory -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgContact | Format-List Id, DisplayName, Mail, MailNickname -{{ Add output here }} +Id : 5d58402b-3cb2-4b17-b913-299a72c84204 +DisplayName : Bob Kelly (TAILSPIN) +Mail : bobk@tailspintoys.com +MailNickname : BobKTAILSPIN ``` -{{ Add description here }} - +This example retrieves all contact objects in the directory. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDomain.md index 093355d11d5..c3544679971 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDomain.md @@ -1,18 +1,26 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get a list of domaim objects -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgDomain | Format-List -{{ Add output here }} +AuthenticationType : Managed +AvailabilityStatus : +DomainNameReferences : +Id : contoso.com +IsAdminManaged : True +IsDefault : True +IsInitial : True +IsRoot : True +IsVerified : True +Manufacturer : +Model : +PasswordNotificationWindowInDays : 14 +PasswordValidityPeriodInDays : 2147483647 +ServiceConfigurationRecords : +State : Microsoft.Graph.PowerShell.Models.MicrosoftGraphDomainState +SupportedServices : {Email, OfficeCommunicationsOnline} +VerificationDnsRecords : +AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#domains/$entity]} ``` -{{ Add description here }} - +This example retrieves a list of the domain objects. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md index 093355d11d5..715c47fb3cd 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRoleMemberByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add a member to a diretory role -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$DirObject = @{ + "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/3d939dc2-d0a0-4d4d-b3f4-6bb75ce6ff6e" + } -{{ Add output here }} +New-MgDirectoryRoleMemberByRef -DirectoryRoleId 'c6bb44c1-73cc-48a1-a73c-b6a977084948' -BodyParameter $DirObject ``` -{{ Add description here }} - +The first command sets the value for the directory object variable $DirObject. The second command assigns the defined directory object the directory role defined by the DirectoryRoleId diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContact.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContact.md index 093355d11d5..ef0efe55e13 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContact.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContact.md @@ -1,18 +1,12 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Retrieve contact objects in the directory -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgContact | Format-List Id, DisplayName, Mail, MailNickname -{{ Add output here }} +Id : 5d58402b-3cb2-4b17-b913-299a72c84204 +DisplayName : Bob Kelly (TAILSPIN) +Mail : bobk@tailspintoys.com +MailNickname : BobKTAILSPIN ``` -{{ Add description here }} - +This example retrieves all contact objects in the directory. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDomain.md index 093355d11d5..c3544679971 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDomain.md @@ -1,18 +1,26 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get a list of domaim objects -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +Get-MgDomain | Format-List -{{ Add output here }} +AuthenticationType : Managed +AvailabilityStatus : +DomainNameReferences : +Id : contoso.com +IsAdminManaged : True +IsDefault : True +IsInitial : True +IsRoot : True +IsVerified : True +Manufacturer : +Model : +PasswordNotificationWindowInDays : 14 +PasswordValidityPeriodInDays : 2147483647 +ServiceConfigurationRecords : +State : Microsoft.Graph.PowerShell.Models.MicrosoftGraphDomainState +SupportedServices : {Email, OfficeCommunicationsOnline} +VerificationDnsRecords : +AdditionalProperties : {[@odata.context, https://graph.microsoft.com/v1.0/$metadata#domains/$entity]} ``` -{{ Add description here }} - +This example retrieves a list of the domain objects. diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRoleMemberByRef.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRoleMemberByRef.md index 093355d11d5..d4e3db91d0f 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRoleMemberByRef.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRoleMemberByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add a member to a diretory role -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$DirObject = @{ + "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/3d939dc2-d0a0-4d4d-b3f4-6bb75ce6ff6e" + } -{{ Add output here }} +New-MgDirectoryRoleMemberByRef -DirectoryRoleId 'c6bb44c1-73cc-48a1-a73c-b6a977084948' -BodyParameter $DirObject ``` -{{ Add description here }} - +The first command sets the value for the directory object variable $DirObject. The second command assigns the defined directory object the directory role defined by the DirectoryRoleId \ No newline at end of file From 5e6be9d8497d01adea08fba7d2160bfcc19ca528 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Fri, 9 Jul 2021 07:18:14 +0300 Subject: [PATCH 4/5] Added more examples --- .../examples/v1.0-beta/Update-MgGroup.md | 21 +++++++------------ .../Groups/examples/v1.0/Update-MgGroup.md | 21 +++++++------------ .../v1.0-beta/Set-MgUserManagerByRef.md | 19 +++++++---------- .../examples/v1.0/Set-MgUserManagerByRef.md | 19 +++++++---------- 4 files changed, 30 insertions(+), 50 deletions(-) diff --git a/src/Groups/Groups/examples/v1.0-beta/Update-MgGroup.md b/src/Groups/Groups/examples/v1.0-beta/Update-MgGroup.md index 093355d11d5..a640c8d1826 100644 --- a/src/Groups/Groups/examples/v1.0-beta/Update-MgGroup.md +++ b/src/Groups/Groups/examples/v1.0-beta/Update-MgGroup.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Update the properties of a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$GroupUpdate= @{ + "Description"= "This is a test group" + "DisplayName"= "Test Group 1" -{{ Add output here }} +Update-MgGroup -GroupId '74a7bfca-7fbc-4a67-b4bb-3ef115b114f1' + -BodyParameter $GroupUpdate ``` -{{ Add description here }} - +In this example, the first command defines a list of all properties that need to be updated and assign then the new values in the variable $GroupUpdate . +The second command updates the properties of the group specified by the GroupId. diff --git a/src/Groups/Groups/examples/v1.0/Update-MgGroup.md b/src/Groups/Groups/examples/v1.0/Update-MgGroup.md index 093355d11d5..a640c8d1826 100644 --- a/src/Groups/Groups/examples/v1.0/Update-MgGroup.md +++ b/src/Groups/Groups/examples/v1.0/Update-MgGroup.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Update the properties of a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$GroupUpdate= @{ + "Description"= "This is a test group" + "DisplayName"= "Test Group 1" -{{ Add output here }} +Update-MgGroup -GroupId '74a7bfca-7fbc-4a67-b4bb-3ef115b114f1' + -BodyParameter $GroupUpdate ``` -{{ Add description here }} - +In this example, the first command defines a list of all properties that need to be updated and assign then the new values in the variable $GroupUpdate . +The second command updates the properties of the group specified by the GroupId. diff --git a/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md b/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md index 093355d11d5..83256cff057 100644 --- a/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md +++ b/src/Users/Users/examples/v1.0-beta/Set-MgUserManagerByRef.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} +### Example 1: Update a user's manager -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$NewManager = @{ + "@odata.id"="https://graph.microsoft.com/v1.0/users/075b32dd-edb7-47cf-89ef-f3f733683a3f" + } -{{ Add output here }} +Set-MgUserManagerByRef -UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' -BodyParameter $NewManager ``` -{{ Add description here }} +In this example, the first command defines the new manager using the $NewManager variable with id `075b32dd-edb7-47cf-89ef-f3f733683a3f`. +The second command sets the manager for user defined by the UserId as the value provided on the $NewManager variable. diff --git a/src/Users/Users/examples/v1.0/Set-MgUserManagerByRef.md b/src/Users/Users/examples/v1.0/Set-MgUserManagerByRef.md index 093355d11d5..83256cff057 100644 --- a/src/Users/Users/examples/v1.0/Set-MgUserManagerByRef.md +++ b/src/Users/Users/examples/v1.0/Set-MgUserManagerByRef.md @@ -1,18 +1,13 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} +### Example 1: Update a user's manager -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$NewManager = @{ + "@odata.id"="https://graph.microsoft.com/v1.0/users/075b32dd-edb7-47cf-89ef-f3f733683a3f" + } -{{ Add output here }} +Set-MgUserManagerByRef -UserId '8a7c50d3-fcbd-4727-a889-8ab232dfea01' -BodyParameter $NewManager ``` -{{ Add description here }} +In this example, the first command defines the new manager using the $NewManager variable with id `075b32dd-edb7-47cf-89ef-f3f733683a3f`. +The second command sets the manager for user defined by the UserId as the value provided on the $NewManager variable. From 6e45579b552c15b7f0dfcd11d9abbfe6e1c06825 Mon Sep 17 00:00:00 2001 From: Eunice Waweru <73849846+msewaweru@users.noreply.github.com> Date: Thu, 15 Jul 2021 12:29:49 +0300 Subject: [PATCH 5/5] Added more examples --- .../examples/v1.0-beta/New-MgApplication.md | 24 ++++++++---------- .../v1.0-beta/New-MgApplicationOwnerByRef.md | 19 +++++--------- .../v1.0-beta/Update-MgServicePrincipal.md | 20 ++++++--------- .../examples/v1.0/New-MgApplication.md | 24 ++++++++---------- .../v1.0/New-MgApplicationOwnerByRef.md | 19 +++++--------- .../v1.0/Update-MgServicePrincipal.md | 20 ++++++--------- .../v1.0-beta/New-MgGroupOwnerByRef.md | 19 +++++--------- .../examples/v1.0/New-MgGroupOwnerByRef.md | 19 +++++--------- .../v1.0-beta/Get-MgUserDirectReport.md | 25 ++++++++----------- .../examples/v1.0/Get-MgUserDirectReport.md | 25 ++++++++----------- 10 files changed, 80 insertions(+), 134 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgApplication.md b/src/Applications/Applications/examples/v1.0-beta/New-MgApplication.md index 093355d11d5..31489edf307 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgApplication.md @@ -1,18 +1,14 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Create a new application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +New-MgApplication -DisplayName 'New app' | + Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain + +Id : 0f0aec7b-ac5b-4f89-9fac-e9044ba5a309 +DisplayName : New app +AppId : c678b75d-1012-4466-8655-1672192232b4 +SignInAudience : AzureADandPersonalMicrosoftAccount +PublisherDomain : M365B977454.onmicrosoft.com ``` -{{ Add description here }} - +This example creates a new application. diff --git a/src/Applications/Applications/examples/v1.0-beta/New-MgApplicationOwnerByRef.md b/src/Applications/Applications/examples/v1.0-beta/New-MgApplicationOwnerByRef.md index 093355d11d5..54881fa23a1 100644 --- a/src/Applications/Applications/examples/v1.0-beta/New-MgApplicationOwnerByRef.md +++ b/src/Applications/Applications/examples/v1.0-beta/New-MgApplicationOwnerByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add an owner to an application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + $NewOwner = @{ + "@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/{075b32dd-edb7-47cf-89ef-f3f733683a3f}" + } -{{ Add output here }} +New-MgApplicationOwnerByRef -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' -BodyParameter $NewOwner ``` -{{ Add description here }} - +In this example, the first command defines the value for the $NewOwner variable. The second command adds the new owner to the specified application. diff --git a/src/Applications/Applications/examples/v1.0-beta/Update-MgServicePrincipal.md b/src/Applications/Applications/examples/v1.0-beta/Update-MgServicePrincipal.md index 093355d11d5..4d3899870ca 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Update-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0-beta/Update-MgServicePrincipal.md @@ -1,18 +1,12 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Update the properties of a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$ServicePrincipalUpdate =@{ + "accountEnabled" = "true" + "appRoleAssignmentRequired" = "true" + } -{{ Add output here }} +Update-MgServicePrincipal -ServicePrincipalId '000e4269-1923-4c8c-9c27-1206e114d421' -BodyParameter $ServicePrincipalUpdate ``` -{{ Add description here }} - +This is example, the first command defines the properties and their values in a hashtable under the variable $ServicePrincipalUpdate. The second command updates the specified service principal. diff --git a/src/Applications/Applications/examples/v1.0/New-MgApplication.md b/src/Applications/Applications/examples/v1.0/New-MgApplication.md index 093355d11d5..31489edf307 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgApplication.md +++ b/src/Applications/Applications/examples/v1.0/New-MgApplication.md @@ -1,18 +1,14 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Create a new application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +New-MgApplication -DisplayName 'New app' | + Format-List Id, DisplayName, AppId, SignInAudience, PublisherDomain + +Id : 0f0aec7b-ac5b-4f89-9fac-e9044ba5a309 +DisplayName : New app +AppId : c678b75d-1012-4466-8655-1672192232b4 +SignInAudience : AzureADandPersonalMicrosoftAccount +PublisherDomain : M365B977454.onmicrosoft.com ``` -{{ Add description here }} - +This example creates a new application. diff --git a/src/Applications/Applications/examples/v1.0/New-MgApplicationOwnerByRef.md b/src/Applications/Applications/examples/v1.0/New-MgApplicationOwnerByRef.md index 093355d11d5..54881fa23a1 100644 --- a/src/Applications/Applications/examples/v1.0/New-MgApplicationOwnerByRef.md +++ b/src/Applications/Applications/examples/v1.0/New-MgApplicationOwnerByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add an owner to an application -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + $NewOwner = @{ + "@odata.id"= "https://graph.microsoft.com/v1.0/directoryObjects/{075b32dd-edb7-47cf-89ef-f3f733683a3f}" + } -{{ Add output here }} +New-MgApplicationOwnerByRef -ApplicationId 'f6b30057-7095-4e2c-89f8-224149f591b7' -BodyParameter $NewOwner ``` -{{ Add description here }} - +In this example, the first command defines the value for the $NewOwner variable. The second command adds the new owner to the specified application. diff --git a/src/Applications/Applications/examples/v1.0/Update-MgServicePrincipal.md b/src/Applications/Applications/examples/v1.0/Update-MgServicePrincipal.md index 093355d11d5..4d3899870ca 100644 --- a/src/Applications/Applications/examples/v1.0/Update-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0/Update-MgServicePrincipal.md @@ -1,18 +1,12 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Update the properties of a service principal -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$ServicePrincipalUpdate =@{ + "accountEnabled" = "true" + "appRoleAssignmentRequired" = "true" + } -{{ Add output here }} +Update-MgServicePrincipal -ServicePrincipalId '000e4269-1923-4c8c-9c27-1206e114d421' -BodyParameter $ServicePrincipalUpdate ``` -{{ Add description here }} - +This is example, the first command defines the properties and their values in a hashtable under the variable $ServicePrincipalUpdate. The second command updates the specified service principal. diff --git a/src/Groups/Groups/examples/v1.0-beta/New-MgGroupOwnerByRef.md b/src/Groups/Groups/examples/v1.0-beta/New-MgGroupOwnerByRef.md index 093355d11d5..b3f4153a1c3 100644 --- a/src/Groups/Groups/examples/v1.0-beta/New-MgGroupOwnerByRef.md +++ b/src/Groups/Groups/examples/v1.0-beta/New-MgGroupOwnerByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add an owner to a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$newGroupOwner =@{ + "@odata.id"= "https://graph.microsoft.com/v1.0/users/{4de19c17-6a28-4a91-86d1-f717c3c8c229}" + } -{{ Add output here }} +New-MgGroupOwnerByRef -GroupId '1cb7317c-9c49-4dc8-a358-67ad8e95217c' -BodyParameter $newGroupOwner ``` -{{ Add description here }} - +In this example, the first command defines the value of the $newGroupOwner variable. The second command creates the value is an owner of the specified group. diff --git a/src/Groups/Groups/examples/v1.0/New-MgGroupOwnerByRef.md b/src/Groups/Groups/examples/v1.0/New-MgGroupOwnerByRef.md index 093355d11d5..b3f4153a1c3 100644 --- a/src/Groups/Groups/examples/v1.0/New-MgGroupOwnerByRef.md +++ b/src/Groups/Groups/examples/v1.0/New-MgGroupOwnerByRef.md @@ -1,18 +1,11 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Add an owner to a group -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} +$newGroupOwner =@{ + "@odata.id"= "https://graph.microsoft.com/v1.0/users/{4de19c17-6a28-4a91-86d1-f717c3c8c229}" + } -{{ Add output here }} +New-MgGroupOwnerByRef -GroupId '1cb7317c-9c49-4dc8-a358-67ad8e95217c' -BodyParameter $newGroupOwner ``` -{{ Add description here }} - +In this example, the first command defines the value of the $newGroupOwner variable. The second command creates the value is an owner of the specified group. diff --git a/src/Users/Users/examples/v1.0-beta/Get-MgUserDirectReport.md b/src/Users/Users/examples/v1.0-beta/Get-MgUserDirectReport.md index 093355d11d5..210d3b360db 100644 --- a/src/Users/Users/examples/v1.0-beta/Get-MgUserDirectReport.md +++ b/src/Users/Users/examples/v1.0-beta/Get-MgUserDirectReport.md @@ -1,18 +1,15 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get a user's direct reports -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Get-MgUserDirectReport -UserId '075b32dd-edb7-47cf-89ef-f3f733683a3f' + +Id DeletedDateTime +-- --------------- +185190a7-54f0-4892-add3-211c21327570 +f890ceed-822a-4647-8748-73d88013ae9d +58fcff93-a667-4c5f-bd43-372a43f446bc +8a7c50d3-fcbd-4727-a889-8ab232dfea01 +68906e46-27f9-4c5e-914b-b931696088fe ``` -{{ Add description here }} - +This example gets the direct reports for the specified user. diff --git a/src/Users/Users/examples/v1.0/Get-MgUserDirectReport.md b/src/Users/Users/examples/v1.0/Get-MgUserDirectReport.md index 093355d11d5..210d3b360db 100644 --- a/src/Users/Users/examples/v1.0/Get-MgUserDirectReport.md +++ b/src/Users/Users/examples/v1.0/Get-MgUserDirectReport.md @@ -1,18 +1,15 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` +### Example 1: Get a user's direct reports -{{ Add description here }} - -### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} +Get-MgUserDirectReport -UserId '075b32dd-edb7-47cf-89ef-f3f733683a3f' + +Id DeletedDateTime +-- --------------- +185190a7-54f0-4892-add3-211c21327570 +f890ceed-822a-4647-8748-73d88013ae9d +58fcff93-a667-4c5f-bd43-372a43f446bc +8a7c50d3-fcbd-4727-a889-8ab232dfea01 +68906e46-27f9-4c5e-914b-b931696088fe ``` -{{ Add description here }} - +This example gets the direct reports for the specified user.