From b06e0715ff8d9b0669dd0d87dc212ef81564b400 Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Fri, 26 May 2023 04:32:20 +0000 Subject: [PATCH] Updating v1 examples --- .../v1.0-beta/Get-MgApplicationTemplate.md | 23 +- .../v1.0-beta/Remove-MgServicePrincipal.md | 25 +- .../v1.0/Get-MgApplicationTemplate.md | 23 +- .../v1.0/Remove-MgServicePrincipal.md | 25 +- .../examples/v1.0-beta/Remove-MgPlace.md | 10 +- .../examples/v1.0-beta/Update-MgPlace.md | 68 +-- .../Calendar/examples/v1.0/Remove-MgPlace.md | 10 +- .../Calendar/examples/v1.0/Update-MgPlace.md | 53 +-- .../examples/v1.0-beta/Get-MgSubscription.md | 27 +- .../examples/v1.0-beta/New-MgSubscription.md | 24 +- .../v1.0-beta/Remove-MgSubscription.md | 20 +- .../v1.0-beta/Update-MgSubscription.md | 19 +- .../examples/v1.0/Get-MgSubscription.md | 27 +- .../examples/v1.0/New-MgSubscription.md | 24 +- .../examples/v1.0/Remove-MgSubscription.md | 20 +- .../examples/v1.0/Update-MgSubscription.md | 19 +- .../v1.0-beta/Get-MgDirectoryObject.md | 16 +- .../v1.0-beta/Remove-MgDirectoryObject.md | 16 +- .../v1.0-beta/Update-MgDirectoryObject.md | 2 +- .../examples/v1.0/Get-MgDirectoryObject.md | 16 +- .../examples/v1.0/Remove-MgDirectoryObject.md | 16 +- .../examples/v1.0/Update-MgDirectoryObject.md | 2 +- ...t-MgShareSharedDriveItemSharedDriveItem.md | 34 +- ...t-MgShareSharedDriveItemSharedDriveItem.md | 34 +- .../v1.0-beta/Get-MgGroupLifecyclePolicy.md | 29 +- .../v1.0-beta/New-MgGroupLifecyclePolicy.md | 21 +- .../Remove-MgGroupLifecyclePolicy.md | 22 +- .../Update-MgGroupLifecyclePolicy.md | 23 +- .../v1.0/Get-MgGroupLifecyclePolicy.md | 29 +- ...roupSettingTemplateGroupSettingTemplate.md | 23 +- .../v1.0/New-MgGroupLifecyclePolicy.md | 21 +- ...roupSettingTemplateGroupSettingTemplate.md | 5 +- .../v1.0/Remove-MgGroupLifecyclePolicy.md | 22 +- ...roupSettingTemplateGroupSettingTemplate.md | 5 +- .../v1.0/Update-MgGroupLifecyclePolicy.md | 23 +- ...roupSettingTemplateGroupSettingTemplate.md | 5 +- .../examples/v1.0-beta/Get-MgContract.md | 23 +- .../examples/v1.0-beta/Get-MgDevice.md | 67 ++- .../v1.0-beta/Get-MgDirectoryRoleTemplate.md | 23 +- .../examples/v1.0-beta/Get-MgOrganization.md | 42 +- .../examples/v1.0-beta/New-MgContact.md | 2 +- .../examples/v1.0-beta/New-MgDevice.md | 66 ++- .../examples/v1.0-beta/New-MgDirectoryRole.md | 19 +- .../examples/v1.0-beta/New-MgDomain.md | 19 +- .../examples/v1.0-beta/Remove-MgDevice.md | 32 +- .../examples/v1.0-beta/Remove-MgDomain.md | 24 +- .../v1.0-beta/Remove-MgOrganization.md | 14 +- .../examples/v1.0-beta/Update-MgDevice.md | 39 +- .../examples/v1.0-beta/Update-MgDomain.md | 21 +- .../v1.0-beta/Update-MgOrganization.md | 31 +- .../examples/v1.0/Get-MgContract.md | 23 +- .../examples/v1.0/Get-MgDevice.md | 74 ++-- .../v1.0/Get-MgDirectoryRoleTemplate.md | 23 +- .../examples/v1.0/Get-MgOrganization.md | 42 +- .../examples/v1.0/New-MgContact.md | 2 +- .../examples/v1.0/New-MgDevice.md | 65 ++- .../examples/v1.0/New-MgDirectoryRole.md | 19 +- .../examples/v1.0/New-MgDomain.md | 19 +- .../examples/v1.0/Remove-MgDevice.md | 32 +- .../examples/v1.0/Remove-MgDomain.md | 24 +- .../examples/v1.0/Remove-MgOrganization.md | 14 +- .../examples/v1.0/Update-MgDevice.md | 36 +- .../examples/v1.0/Update-MgDomain.md | 21 +- .../examples/v1.0/Update-MgOrganization.md | 31 +- .../v1.0-beta/Get-MgDataPolicyOperation.md | 16 +- .../v1.0-beta/Get-MgOauth2PermissionGrant.md | 27 +- .../examples/v1.0-beta/New-MgInvitation.md | 4 +- .../v1.0-beta/New-MgOauth2PermissionGrant.md | 24 +- .../Remove-MgOauth2PermissionGrant.md | 20 +- .../Update-MgOauth2PermissionGrant.md | 19 +- .../v1.0/Get-MgDataPolicyOperation.md | 16 +- .../v1.0/Get-MgOauth2PermissionGrant.md | 27 +- .../v1.0/New-MgOauth2PermissionGrant.md | 22 +- .../v1.0/Remove-MgOauth2PermissionGrant.md | 20 +- .../v1.0/Update-MgOauth2PermissionGrant.md | 19 +- .../v1.0-beta/Get-MgSchemaExtension.md | 45 +- .../v1.0-beta/New-MgSchemaExtension.md | 94 +---- .../v1.0-beta/Remove-MgSchemaExtension.md | 38 +- .../v1.0-beta/Update-MgSchemaExtension.md | 65 +-- .../examples/v1.0/Get-MgSchemaExtension.md | 45 +- .../examples/v1.0/New-MgSchemaExtension.md | 94 +---- .../examples/v1.0/Remove-MgSchemaExtension.md | 38 +- .../examples/v1.0/Update-MgSchemaExtension.md | 65 +-- .../Sites/examples/v1.0-beta/Get-MgSite.md | 51 +-- src/Sites/Sites/examples/v1.0/Get-MgSite.md | 30 +- .../Teams/examples/v1.0-beta/Get-MgChat.md | 48 +-- .../Teams/examples/v1.0-beta/Get-MgTeam.md | 58 ++- .../Teams/examples/v1.0-beta/New-MgChat.md | 248 ++--------- .../Teams/examples/v1.0-beta/New-MgTeam.md | 391 +++++++++--------- .../Teams/examples/v1.0-beta/Remove-MgChat.md | 2 +- .../Teams/examples/v1.0-beta/Remove-MgTeam.md | 16 +- .../Teams/examples/v1.0-beta/Update-MgChat.md | 19 +- .../Teams/examples/v1.0-beta/Update-MgTeam.md | 37 +- src/Teams/Teams/examples/v1.0/Get-MgChat.md | 41 +- src/Teams/Teams/examples/v1.0/Get-MgTeam.md | 30 +- src/Teams/Teams/examples/v1.0/New-MgChat.md | 217 ++-------- src/Teams/Teams/examples/v1.0/New-MgTeam.md | 388 +++++++++-------- .../Teams/examples/v1.0/Remove-MgChat.md | 2 +- .../Teams/examples/v1.0/Remove-MgTeam.md | 16 +- .../Teams/examples/v1.0/Update-MgChat.md | 19 +- .../Teams/examples/v1.0/Update-MgTeam.md | 33 +- 101 files changed, 1807 insertions(+), 2165 deletions(-) diff --git a/src/Applications/Applications/examples/v1.0-beta/Get-MgApplicationTemplate.md b/src/Applications/Applications/examples/v1.0-beta/Get-MgApplicationTemplate.md index 3d6e1be9646..8013df6f4ad 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Get-MgApplicationTemplate.md +++ b/src/Applications/Applications/examples/v1.0-beta/Get-MgApplicationTemplate.md @@ -1,14 +1,9 @@ -### Example 1: Using the Get-MgApplicationTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Applications -Get-MgApplicationTemplate -ApplicationTemplateId $applicationTemplateId -``` -This example shows how to use the Get-MgApplicationTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgApplicationTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Applications -Get-MgApplicationTemplate -``` -This example shows how to use the Get-MgApplicationTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Applications + +Get-MgApplicationTemplate -ApplicationTemplateId $applicationTemplateId +``` +This example shows how to use the Get-MgApplicationTemplate Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipal.md b/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipal.md index c8cdcb99005..9f46fd7d2bf 100644 --- a/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0-beta/Remove-MgServicePrincipal.md @@ -1,7 +1,18 @@ -### Example 1: Using the Remove-MgServicePrincipal Cmdlet -```powershell -Import-Module Microsoft.Graph.Applications -Remove-MgServicePrincipal -ServicePrincipalId $servicePrincipalId -``` -This example shows how to use the Remove-MgServicePrincipal Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Retrieve a service principal by its ID + +```powershell Import-Module Microsoft.Graph.Applications + +Get-MgServicePrincipal -ServicePrincipalId $servicePrincipalId +``` +This example shows how to use the Remove-MgServicePrincipal Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Retrieve the specific properties of a service principal + +```powershell Import-Module Microsoft.Graph.Applications + +Get-MgServicePrincipal -ServicePrincipalId $servicePrincipalId -Property "id,appId,displayName,appRoles,oauth2PermissionScopes" +``` +This example shows how to use the Remove-MgServicePrincipal Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Applications/Applications/examples/v1.0/Get-MgApplicationTemplate.md b/src/Applications/Applications/examples/v1.0/Get-MgApplicationTemplate.md index 3d6e1be9646..8013df6f4ad 100644 --- a/src/Applications/Applications/examples/v1.0/Get-MgApplicationTemplate.md +++ b/src/Applications/Applications/examples/v1.0/Get-MgApplicationTemplate.md @@ -1,14 +1,9 @@ -### Example 1: Using the Get-MgApplicationTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Applications -Get-MgApplicationTemplate -ApplicationTemplateId $applicationTemplateId -``` -This example shows how to use the Get-MgApplicationTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgApplicationTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Applications -Get-MgApplicationTemplate -``` -This example shows how to use the Get-MgApplicationTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Applications + +Get-MgApplicationTemplate -ApplicationTemplateId $applicationTemplateId +``` +This example shows how to use the Get-MgApplicationTemplate Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md b/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md index c8cdcb99005..9f46fd7d2bf 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md @@ -1,7 +1,18 @@ -### Example 1: Using the Remove-MgServicePrincipal Cmdlet -```powershell -Import-Module Microsoft.Graph.Applications -Remove-MgServicePrincipal -ServicePrincipalId $servicePrincipalId -``` -This example shows how to use the Remove-MgServicePrincipal Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Retrieve a service principal by its ID + +```powershell Import-Module Microsoft.Graph.Applications + +Get-MgServicePrincipal -ServicePrincipalId $servicePrincipalId +``` +This example shows how to use the Remove-MgServicePrincipal Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Retrieve the specific properties of a service principal + +```powershell Import-Module Microsoft.Graph.Applications + +Get-MgServicePrincipal -ServicePrincipalId $servicePrincipalId -Property "id,appId,displayName,appRoles,oauth2PermissionScopes" +``` +This example shows how to use the Remove-MgServicePrincipal Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Calendar/Calendar/examples/v1.0-beta/Remove-MgPlace.md b/src/Calendar/Calendar/examples/v1.0-beta/Remove-MgPlace.md index ffe4e5f0b45..3bc607a00fb 100644 --- a/src/Calendar/Calendar/examples/v1.0-beta/Remove-MgPlace.md +++ b/src/Calendar/Calendar/examples/v1.0-beta/Remove-MgPlace.md @@ -4,11 +4,11 @@ $params = @{ "@odata.type" = "microsoft.graph.room" - Nickname = "Conf Room" - Building = "1" - Label = "100" - Capacity = - IsWheelChairAccessible = $false + nickname = "Conf Room" + building = "1" + label = "100" + capacity = + isWheelChairAccessible = $false } Update-MgPlace -PlaceId $placeId -BodyParameter $params diff --git a/src/Calendar/Calendar/examples/v1.0-beta/Update-MgPlace.md b/src/Calendar/Calendar/examples/v1.0-beta/Update-MgPlace.md index 5915276ef61..b079cacb455 100644 --- a/src/Calendar/Calendar/examples/v1.0-beta/Update-MgPlace.md +++ b/src/Calendar/Calendar/examples/v1.0-beta/Update-MgPlace.md @@ -1,56 +1,18 @@ -### Example 1: Using the Update-MgPlace Cmdlet -```powershell -Import-Module Microsoft.Graph.Calendar +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Calendar + $params = @{ "@odata.type" = "microsoft.graph.room" - Nickname = "Conf Room" - Building = "1" - Label = "100" - Capacity = - IsWheelChairAccessible = $false + nickname = "Conf Room" + building = "1" + label = "100" + capacity = + isWheelChairAccessible = $false } -Update-MgPlace -PlaceId $placeId -BodyParameter $params -``` -This example shows how to use the Update-MgPlace Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Update-MgPlace Cmdlet -```powershell -Import-Module Microsoft.Graph.Calendar -$params = @{ - "@odata.type" = "microsoft.graph.roomList" - DisplayName = "Building 1" - Phone = "555-555-0100" - Address = @{ - Street = "4567 Main Street" - City = "Buffalo" - State = "NY" - PostalCode = "98052" - CountryOrRegion = "USA" - } - GeoCoordinates = @{ - Altitude = $null - Latitude = 47 - Longitude = -122 - Accuracy = $null - AltitudeAccuracy = $null - } -} -Update-MgPlace -PlaceId $placeId -BodyParameter $params -``` -This example shows how to use the Update-MgPlace Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Update-MgPlace Cmdlet -```powershell -Import-Module Microsoft.Graph.Calendar -$params = @{ - "@odata.type" = "microsoft.graph.workspace" - Nickname = "Conf Room" - Building = "1" - Label = "100" - Capacity = - IsWheelChairAccessible = $false -} -Update-MgPlace -PlaceId $placeId -BodyParameter $params -``` -This example shows how to use the Update-MgPlace Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgPlace -PlaceId $placeId -BodyParameter $params +``` +This example shows how to use the Update-MgPlace Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Calendar/Calendar/examples/v1.0/Remove-MgPlace.md b/src/Calendar/Calendar/examples/v1.0/Remove-MgPlace.md index ffe4e5f0b45..3bc607a00fb 100644 --- a/src/Calendar/Calendar/examples/v1.0/Remove-MgPlace.md +++ b/src/Calendar/Calendar/examples/v1.0/Remove-MgPlace.md @@ -4,11 +4,11 @@ $params = @{ "@odata.type" = "microsoft.graph.room" - Nickname = "Conf Room" - Building = "1" - Label = "100" - Capacity = - IsWheelChairAccessible = $false + nickname = "Conf Room" + building = "1" + label = "100" + capacity = + isWheelChairAccessible = $false } Update-MgPlace -PlaceId $placeId -BodyParameter $params diff --git a/src/Calendar/Calendar/examples/v1.0/Update-MgPlace.md b/src/Calendar/Calendar/examples/v1.0/Update-MgPlace.md index cb3f45cc1af..b079cacb455 100644 --- a/src/Calendar/Calendar/examples/v1.0/Update-MgPlace.md +++ b/src/Calendar/Calendar/examples/v1.0/Update-MgPlace.md @@ -1,41 +1,18 @@ -### Example 1: Using the Update-MgPlace Cmdlet -```powershell -Import-Module Microsoft.Graph.Calendar +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Calendar + $params = @{ "@odata.type" = "microsoft.graph.room" - Nickname = "Conf Room" - Building = "1" - Label = "100" - Capacity = - IsWheelChairAccessible = $false + nickname = "Conf Room" + building = "1" + label = "100" + capacity = + isWheelChairAccessible = $false } -Update-MgPlace -PlaceId $placeId -BodyParameter $params -``` -This example shows how to use the Update-MgPlace Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Update-MgPlace Cmdlet -```powershell -Import-Module Microsoft.Graph.Calendar -$params = @{ - "@odata.type" = "microsoft.graph.roomList" - DisplayName = "Building 1" - Phone = "555-555-0100" - Address = @{ - Street = "4567 Main Street" - City = "Buffalo" - State = "NY" - PostalCode = "98052" - CountryOrRegion = "USA" - } - GeoCoordinates = @{ - Altitude = $null - Latitude = 47 - Longitude = -122 - Accuracy = $null - AltitudeAccuracy = $null - } -} -Update-MgPlace -PlaceId $placeId -BodyParameter $params -``` -This example shows how to use the Update-MgPlace Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgPlace -PlaceId $placeId -BodyParameter $params +``` +This example shows how to use the Update-MgPlace Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Get-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Get-MgSubscription.md index 1769d906f4e..76ddf1fb173 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Get-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Get-MgSubscription.md @@ -1,14 +1,13 @@ -### Example 1: Using the Get-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -Get-MgSubscription -SubscriptionId $subscriptionId -``` -This example shows how to use the Get-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -Get-MgSubscription -``` -This example shows how to use the Get-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + +$params = @{ + expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") +} + +Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params +``` +This example shows how to use the Get-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/New-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/New-MgSubscription.md index 04a885a039d..aad2f81acc3 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/New-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/New-MgSubscription.md @@ -1,15 +1,9 @@ -### Example 1: Using the New-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -$params = @{ - ChangeType = "created" - NotificationUrl = "https://webhook.azurewebsites.net/api/send/myNotifyClient" - Resource = "me/mailFolders('Inbox')/messages" - ExpirationDateTime = [System.DateTime]::Parse("2016-11-20T18:23:45.9356913Z") - ClientState = "secretClientValue" - LatestSupportedTlsVersion = "v1_2" -} -New-MgSubscription -BodyParameter $params -``` -This example shows how to use the New-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + +Get-MgSubscription +``` +This example shows how to use the New-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Remove-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Remove-MgSubscription.md index b3e85fc18fc..cc64212f137 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Remove-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Remove-MgSubscription.md @@ -1,7 +1,13 @@ -### Example 1: Using the Remove-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -Remove-MgSubscription -SubscriptionId $subscriptionId -``` -This example shows how to use the Remove-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + +$params = @{ + expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") +} + +Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params +``` +This example shows how to use the Remove-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Update-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Update-MgSubscription.md index 63f13de21ad..bb9c0ae8805 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Update-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0-beta/Update-MgSubscription.md @@ -1,10 +1,13 @@ -### Example 1: Using the Update-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + $params = @{ - ExpirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") + expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") } -Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params -``` -This example shows how to use the Update-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params +``` +This example shows how to use the Update-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md index 1769d906f4e..76ddf1fb173 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md @@ -1,14 +1,13 @@ -### Example 1: Using the Get-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -Get-MgSubscription -SubscriptionId $subscriptionId -``` -This example shows how to use the Get-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -Get-MgSubscription -``` -This example shows how to use the Get-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + +$params = @{ + expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") +} + +Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params +``` +This example shows how to use the Get-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md index 04a885a039d..aad2f81acc3 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md @@ -1,15 +1,9 @@ -### Example 1: Using the New-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -$params = @{ - ChangeType = "created" - NotificationUrl = "https://webhook.azurewebsites.net/api/send/myNotifyClient" - Resource = "me/mailFolders('Inbox')/messages" - ExpirationDateTime = [System.DateTime]::Parse("2016-11-20T18:23:45.9356913Z") - ClientState = "secretClientValue" - LatestSupportedTlsVersion = "v1_2" -} -New-MgSubscription -BodyParameter $params -``` -This example shows how to use the New-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + +Get-MgSubscription +``` +This example shows how to use the New-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md index b3e85fc18fc..cc64212f137 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md @@ -1,7 +1,13 @@ -### Example 1: Using the Remove-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications -Remove-MgSubscription -SubscriptionId $subscriptionId -``` -This example shows how to use the Remove-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + +$params = @{ + expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") +} + +Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params +``` +This example shows how to use the Remove-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Update-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Update-MgSubscription.md index 63f13de21ad..bb9c0ae8805 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Update-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Update-MgSubscription.md @@ -1,10 +1,13 @@ -### Example 1: Using the Update-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.ChangeNotifications + $params = @{ - ExpirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") + expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z") } -Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params -``` -This example shows how to use the Update-MgSubscription Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params +``` +This example shows how to use the Update-MgSubscription Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Get-MgDirectoryObject.md b/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Get-MgDirectoryObject.md index c78fa264d7b..96d728fa9b1 100644 --- a/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Get-MgDirectoryObject.md +++ b/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Get-MgDirectoryObject.md @@ -1,7 +1,9 @@ -### Example 1: Using the Get-MgDirectoryObject Cmdlet -```powershell -Import-Module Microsoft.Graph.DirectoryObjects -Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId -``` -This example shows how to use the Get-MgDirectoryObject Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.DirectoryObjects + +Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId +``` +This example shows how to use the Get-MgDirectoryObject Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Remove-MgDirectoryObject.md b/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Remove-MgDirectoryObject.md index 225c5f869ba..d006696f4f1 100644 --- a/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Remove-MgDirectoryObject.md +++ b/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Remove-MgDirectoryObject.md @@ -1,7 +1,9 @@ -### Example 1: Using the Remove-MgDirectoryObject Cmdlet -```powershell -Import-Module Microsoft.Graph.DirectoryObjects -Remove-MgDirectoryObject -DirectoryObjectId $directoryObjectId -``` -This example shows how to use the Remove-MgDirectoryObject Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.DirectoryObjects + +Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId +``` +This example shows how to use the Remove-MgDirectoryObject Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Update-MgDirectoryObject.md b/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Update-MgDirectoryObject.md index cbd3baa84fe..f361d033aee 100644 --- a/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Update-MgDirectoryObject.md +++ b/src/DirectoryObjects/DirectoryObjects/examples/v1.0-beta/Update-MgDirectoryObject.md @@ -2,7 +2,7 @@ ```powershell Import-Module Microsoft.Graph.DirectoryObjects -Remove-MgDirectoryObject -DirectoryObjectId $directoryObjectId +Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId ``` This example shows how to use the Update-MgDirectoryObject Cmdlet. To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). diff --git a/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Get-MgDirectoryObject.md b/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Get-MgDirectoryObject.md index c78fa264d7b..96d728fa9b1 100644 --- a/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Get-MgDirectoryObject.md +++ b/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Get-MgDirectoryObject.md @@ -1,7 +1,9 @@ -### Example 1: Using the Get-MgDirectoryObject Cmdlet -```powershell -Import-Module Microsoft.Graph.DirectoryObjects -Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId -``` -This example shows how to use the Get-MgDirectoryObject Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.DirectoryObjects + +Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId +``` +This example shows how to use the Get-MgDirectoryObject Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Remove-MgDirectoryObject.md b/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Remove-MgDirectoryObject.md index 225c5f869ba..d006696f4f1 100644 --- a/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Remove-MgDirectoryObject.md +++ b/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Remove-MgDirectoryObject.md @@ -1,7 +1,9 @@ -### Example 1: Using the Remove-MgDirectoryObject Cmdlet -```powershell -Import-Module Microsoft.Graph.DirectoryObjects -Remove-MgDirectoryObject -DirectoryObjectId $directoryObjectId -``` -This example shows how to use the Remove-MgDirectoryObject Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.DirectoryObjects + +Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId +``` +This example shows how to use the Remove-MgDirectoryObject Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Update-MgDirectoryObject.md b/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Update-MgDirectoryObject.md index cbd3baa84fe..f361d033aee 100644 --- a/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Update-MgDirectoryObject.md +++ b/src/DirectoryObjects/DirectoryObjects/examples/v1.0/Update-MgDirectoryObject.md @@ -2,7 +2,7 @@ ```powershell Import-Module Microsoft.Graph.DirectoryObjects -Remove-MgDirectoryObject -DirectoryObjectId $directoryObjectId +Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId ``` This example shows how to use the Update-MgDirectoryObject Cmdlet. To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). diff --git a/src/Files/Files/examples/v1.0-beta/Get-MgShareSharedDriveItemSharedDriveItem.md b/src/Files/Files/examples/v1.0-beta/Get-MgShareSharedDriveItemSharedDriveItem.md index bf2eb45757a..a126fc8c3eb 100644 --- a/src/Files/Files/examples/v1.0-beta/Get-MgShareSharedDriveItemSharedDriveItem.md +++ b/src/Files/Files/examples/v1.0-beta/Get-MgShareSharedDriveItemSharedDriveItem.md @@ -1,7 +1,27 @@ -### Example 1: Using the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet -```powershell -Import-Module Microsoft.Graph.Files -Get-MgShareSharedDriveItemSharedDriveItem -SharedDriveItemId $sharedDriveItemId -``` -This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Files + +Get-MgShareSharedDriveItemSharedDriveItem -SharedDriveItemId $sharedDriveItemId +``` +This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Code snippet + +```powershell Import-Module Microsoft.Graph.Files + +Get-MgShareDriveItem -SharedDriveItemId $sharedDriveItemId +``` +This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: Code snippet + +```powershell Import-Module Microsoft.Graph.Files + +Get-MgShareDriveItem -SharedDriveItemId $sharedDriveItemId -ExpandProperty "children" +``` +This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md b/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md index bf2eb45757a..a126fc8c3eb 100644 --- a/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md +++ b/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md @@ -1,7 +1,27 @@ -### Example 1: Using the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet -```powershell -Import-Module Microsoft.Graph.Files -Get-MgShareSharedDriveItemSharedDriveItem -SharedDriveItemId $sharedDriveItemId -``` -This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Files + +Get-MgShareSharedDriveItemSharedDriveItem -SharedDriveItemId $sharedDriveItemId +``` +This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Code snippet + +```powershell Import-Module Microsoft.Graph.Files + +Get-MgShareDriveItem -SharedDriveItemId $sharedDriveItemId +``` +This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: Code snippet + +```powershell Import-Module Microsoft.Graph.Files + +Get-MgShareDriveItem -SharedDriveItemId $sharedDriveItemId -ExpandProperty "children" +``` +This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupLifecyclePolicy.md index 7f106a34079..7e15a7e8352 100644 --- a/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0-beta/Get-MgGroupLifecyclePolicy.md @@ -1,14 +1,15 @@ -### Example 1: Using the Get-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -Get-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -``` -This example shows how to use the Get-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -Get-MgGroupLifecyclePolicy -``` -This example shows how to use the Get-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + +$params = @{ + groupLifetimeInDays = 180 + managedGroupTypes = "Selected" + alternateNotificationEmails = "admin@contoso.com" +} + +Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params +``` +This example shows how to use the Get-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0-beta/New-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0-beta/New-MgGroupLifecyclePolicy.md index c8c8d6981bc..2cf0db68f40 100644 --- a/src/Groups/Groups/examples/v1.0-beta/New-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0-beta/New-MgGroupLifecyclePolicy.md @@ -1,12 +1,9 @@ -### Example 1: Using the New-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -$params = @{ - GroupLifetimeInDays = 100 - ManagedGroupTypes = "Selected" - AlternateNotificationEmails = "admin@contoso.com" -} -New-MgGroupLifecyclePolicy -BodyParameter $params -``` -This example shows how to use the New-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + +Get-MgGroupLifecyclePolicy +``` +This example shows how to use the New-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroupLifecyclePolicy.md index e35851c5eb5..032d9549d7c 100644 --- a/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0-beta/Remove-MgGroupLifecyclePolicy.md @@ -1,7 +1,15 @@ -### Example 1: Using the Remove-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -Remove-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -``` -This example shows how to use the Remove-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + +$params = @{ + groupLifetimeInDays = 180 + managedGroupTypes = "Selected" + alternateNotificationEmails = "admin@contoso.com" +} + +Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params +``` +This example shows how to use the Remove-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0-beta/Update-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0-beta/Update-MgGroupLifecyclePolicy.md index 5c1306ba208..b8f012c1717 100644 --- a/src/Groups/Groups/examples/v1.0-beta/Update-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0-beta/Update-MgGroupLifecyclePolicy.md @@ -1,12 +1,15 @@ -### Example 1: Using the Update-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + $params = @{ - GroupLifetimeInDays = 180 - ManagedGroupTypes = "Selected" - AlternateNotificationEmails = "admin@contoso.com" + groupLifetimeInDays = 180 + managedGroupTypes = "Selected" + alternateNotificationEmails = "admin@contoso.com" } -Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params -``` -This example shows how to use the Update-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params +``` +This example shows how to use the Update-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md index 7f106a34079..7e15a7e8352 100644 --- a/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md @@ -1,14 +1,15 @@ -### Example 1: Using the Get-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -Get-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -``` -This example shows how to use the Get-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -Get-MgGroupLifecyclePolicy -``` -This example shows how to use the Get-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + +$params = @{ + groupLifetimeInDays = 180 + managedGroupTypes = "Selected" + alternateNotificationEmails = "admin@contoso.com" +} + +Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params +``` +This example shows how to use the Get-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0/Get-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md b/src/Groups/Groups/examples/v1.0/Get-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md index 093355d11d5..73d0426c03e 100644 --- a/src/Groups/Groups/examples/v1.0/Get-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md +++ b/src/Groups/Groups/examples/v1.0/Get-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md @@ -1,18 +1,9 @@ -### Example 1: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} +### Example 1: Code snippet -{{ Add output here }} -``` - -{{ Add description here }} - -### Example 2: {{ Add title here }} -```powershell -PS C:\> {{ Add code here }} - -{{ Add output here }} -``` - -{{ Add description here }} +```powershell Import-Module Microsoft.Graph.Groups +Get-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate -GroupSettingTemplateId $groupSettingTemplateId +``` +This example shows how to use the Get-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0/New-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0/New-MgGroupLifecyclePolicy.md index c8c8d6981bc..2cf0db68f40 100644 --- a/src/Groups/Groups/examples/v1.0/New-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/New-MgGroupLifecyclePolicy.md @@ -1,12 +1,9 @@ -### Example 1: Using the New-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -$params = @{ - GroupLifetimeInDays = 100 - ManagedGroupTypes = "Selected" - AlternateNotificationEmails = "admin@contoso.com" -} -New-MgGroupLifecyclePolicy -BodyParameter $params -``` -This example shows how to use the New-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + +Get-MgGroupLifecyclePolicy +``` +This example shows how to use the New-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0/New-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md b/src/Groups/Groups/examples/v1.0/New-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md index 093355d11d5..f6c6949389e 100644 --- a/src/Groups/Groups/examples/v1.0/New-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md +++ b/src/Groups/Groups/examples/v1.0/New-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md @@ -1,6 +1,6 @@ ### Example 1: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + PS C:\> {{ Add code here }} {{ Add output here }} ``` @@ -9,10 +9,9 @@ PS C:\> {{ Add code here }} ### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + PS C:\> {{ Add code here }} {{ Add output here }} ``` {{ Add description here }} - diff --git a/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md index e35851c5eb5..032d9549d7c 100644 --- a/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md @@ -1,7 +1,15 @@ -### Example 1: Using the Remove-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups -Remove-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -``` -This example shows how to use the Remove-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + +$params = @{ + groupLifetimeInDays = 180 + managedGroupTypes = "Selected" + alternateNotificationEmails = "admin@contoso.com" +} + +Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params +``` +This example shows how to use the Remove-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0/Remove-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md b/src/Groups/Groups/examples/v1.0/Remove-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md index 093355d11d5..f6c6949389e 100644 --- a/src/Groups/Groups/examples/v1.0/Remove-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md +++ b/src/Groups/Groups/examples/v1.0/Remove-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md @@ -1,6 +1,6 @@ ### Example 1: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + PS C:\> {{ Add code here }} {{ Add output here }} ``` @@ -9,10 +9,9 @@ PS C:\> {{ Add code here }} ### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + PS C:\> {{ Add code here }} {{ Add output here }} ``` {{ Add description here }} - diff --git a/src/Groups/Groups/examples/v1.0/Update-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0/Update-MgGroupLifecyclePolicy.md index 5c1306ba208..b8f012c1717 100644 --- a/src/Groups/Groups/examples/v1.0/Update-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/Update-MgGroupLifecyclePolicy.md @@ -1,12 +1,15 @@ -### Example 1: Using the Update-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + $params = @{ - GroupLifetimeInDays = 180 - ManagedGroupTypes = "Selected" - AlternateNotificationEmails = "admin@contoso.com" + groupLifetimeInDays = 180 + managedGroupTypes = "Selected" + alternateNotificationEmails = "admin@contoso.com" } -Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params -``` -This example shows how to use the Update-MgGroupLifecyclePolicy Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgGroupLifecyclePolicy -GroupLifecyclePolicyId $groupLifecyclePolicyId -BodyParameter $params +``` +This example shows how to use the Update-MgGroupLifecyclePolicy Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Groups/Groups/examples/v1.0/Update-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md b/src/Groups/Groups/examples/v1.0/Update-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md index 093355d11d5..f6c6949389e 100644 --- a/src/Groups/Groups/examples/v1.0/Update-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md +++ b/src/Groups/Groups/examples/v1.0/Update-MgGroupSettingTemplateGroupSettingTemplateGroupSettingTemplate.md @@ -1,6 +1,6 @@ ### Example 1: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + PS C:\> {{ Add code here }} {{ Add output here }} ``` @@ -9,10 +9,9 @@ PS C:\> {{ Add code here }} ### Example 2: {{ Add title here }} ```powershell -PS C:\> {{ Add code here }} + PS C:\> {{ Add code here }} {{ Add output here }} ``` {{ Add description here }} - diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContract.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContract.md index c2d402b792b..4422efae40f 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContract.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgContract.md @@ -1,14 +1,9 @@ -### Example 1: Using the Get-MgContract Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgContract -ContractId $contractId -``` -This example shows how to use the Get-MgContract Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgContract Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgContract -``` -This example shows how to use the Get-MgContract Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgContract -ContractId $contractId +``` +This example shows how to use the Get-MgContract Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDevice.md index c41183e4c53..f8096f2993f 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDevice.md @@ -1,42 +1,25 @@ -### Example 1: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -DeviceId $deviceId -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -DeviceId $deviceId -Property "id,extensionAttributes" -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Filter "extensionAttributes/extensionAttribute1 eq 'BYOD-Device'" -CountVariable CountVar -ConsistencyLevel eventual -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Property "id,extensionAttributes" -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Filter "startswith(displayName, 'a')" -CountVariable CountVar -Top 1 -Sort "displayName" -ConsistencyLevel eventual -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Update the accountEnabled property of a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + accountEnabled = $false +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Get-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Write extensionAttributes on a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Get-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleTemplate.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleTemplate.md index e8e27e057f0..f5847871613 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleTemplate.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgDirectoryRoleTemplate.md @@ -1,14 +1,9 @@ -### Example 1: Using the Get-MgDirectoryRoleTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDirectoryRoleTemplate -DirectoryRoleTemplateId $directoryRoleTemplateId -``` -This example shows how to use the Get-MgDirectoryRoleTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgDirectoryRoleTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDirectoryRoleTemplate -``` -This example shows how to use the Get-MgDirectoryRoleTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDirectoryRoleTemplate -DirectoryRoleTemplateId $directoryRoleTemplateId +``` +This example shows how to use the Get-MgDirectoryRoleTemplate Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgOrganization.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgOrganization.md index bf1a20a58cb..9e5a1cef480 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgOrganization.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Get-MgOrganization.md @@ -1,14 +1,28 @@ -### Example 1: Using the Get-MgOrganization Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgOrganization -OrganizationId $organizationId -``` -This example shows how to use the Get-MgOrganization Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgOrganization Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgOrganization -``` -This example shows how to use the Get-MgOrganization Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + marketingNotificationEmails = @( + "marketing@contoso.com" + ) + privacyProfile = @{ + contactEmail = "alice@contoso.com" + statementUrl = "https://contoso.com/privacyStatement" + } + securityComplianceNotificationMails = @( + "security@contoso.com" + ) + securityComplianceNotificationPhones = @( + "(123) 456-7890" + ) + technicalNotificationMails = @( + "tech@contoso.com" + ) +} + +Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params +``` +This example shows how to use the Get-MgOrganization Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgContact.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgContact.md index 44d04424b5e..ac9ce6aa967 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgContact.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgContact.md @@ -20,7 +20,7 @@ This example shows how to use the New-MgContact Cmdlet. ```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgContact -Search "displayName:wa" -CountVariable CountVar -ConsistencyLevel eventual +Get-MgContact -Search '"displayName:wa"' -CountVariable CountVar -ConsistencyLevel eventual ``` This example shows how to use the New-MgContact Cmdlet. To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDevice.md index 60fef51b1c8..2d8e030a3cd 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDevice.md @@ -1,21 +1,45 @@ -### Example 1: Using the New-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - AccountEnabled = $true - AlternativeSecurityIds = @( - @{ - Type = 99 - IdentityProvider = "identityProvider-value" - Key = [System.Text.Encoding]::ASCII.GetBytes("base64Y3YxN2E1MWFlYw==") - } - ) - ApproximateLastSignInDateTime = [System.DateTime]::Parse("2016-10-19T10:37:00Z") - DeviceId = "deviceId-value" - DeviceMetadata = "deviceMetadata-value" - DeviceVersion = 99 -} -New-MgDevice -BodyParameter $params -``` -This example shows how to use the New-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Property "id,extensionAttributes" +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Filter "startswith(displayName, 'a')" -CountVariable CountVar -Top 1 -Sort "displayName" -ConsistencyLevel eventual +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 4: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Search '"displayName:Android"' -CountVariable CountVar -ConsistencyLevel eventual +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 5: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Filter "extensionAttributes/extensionAttribute1 eq 'BYOD-Device'" -CountVariable CountVar -ConsistencyLevel eventual +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRole.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRole.md index 14ef0502506..700c605d095 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRole.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDirectoryRole.md @@ -1,10 +1,9 @@ -### Example 1: Using the New-MgDirectoryRole Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - RoleTemplateId = "fe930be7-5e62-47db-91af-98c3a49a38b1" -} -New-MgDirectoryRole -BodyParameter $params -``` -This example shows how to use the New-MgDirectoryRole Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDirectoryRole +``` +This example shows how to use the New-MgDirectoryRole Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDomain.md index f88d172ca2d..d3b157bbca2 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/New-MgDomain.md @@ -1,10 +1,9 @@ -### Example 1: Using the New-MgDomain Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - Id = "contoso.com" -} -New-MgDomain -BodyParameter $params -``` -This example shows how to use the New-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDomain +``` +This example shows how to use the New-MgDomain Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDevice.md index f95ac3817a5..af6825a977b 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDevice.md @@ -1,7 +1,25 @@ -### Example 1: Using the Remove-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Remove-MgDevice -DeviceId $deviceId -``` -This example shows how to use the Remove-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Update the accountEnabled property of a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + accountEnabled = $false +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Remove-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Write extensionAttributes on a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Remove-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDomain.md index 9a3adcac02e..1d3da9dd709 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgDomain.md @@ -1,7 +1,17 @@ -### Example 1: Using the Remove-MgDomain Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Remove-MgDomain -DomainId $domainId -``` -This example shows how to use the Remove-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + isDefault = $true + supportedServices = @( + "Email" + "OfficeCommunicationsOnline" + ) +} + +Update-MgDomain -DomainId $domainId -BodyParameter $params +``` +This example shows how to use the Remove-MgDomain Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgOrganization.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgOrganization.md index 8e4c8307f64..d83f2afe816 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgOrganization.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Remove-MgOrganization.md @@ -3,20 +3,20 @@ ```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement $params = @{ - MarketingNotificationEmails = @( + marketingNotificationEmails = @( "marketing@contoso.com" ) - PrivacyProfile = @{ - ContactEmail = "alice@contoso.com" - StatementUrl = "https://contoso.com/privacyStatement" + privacyProfile = @{ + contactEmail = "alice@contoso.com" + statementUrl = "https://contoso.com/privacyStatement" } - SecurityComplianceNotificationMails = @( + securityComplianceNotificationMails = @( "security@contoso.com" ) - SecurityComplianceNotificationPhones = @( + securityComplianceNotificationPhones = @( "(123) 456-7890" ) - TechnicalNotificationMails = @( + technicalNotificationMails = @( "tech@contoso.com" ) } diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDevice.md index b3cb724c543..f12d4d22d39 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDevice.md @@ -1,22 +1,25 @@ -### Example 1: Using the Update-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Update the accountEnabled property of a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - ExtensionAttributes = @{ - ExtensionAttribute1 = "BYOD-Device" - } + accountEnabled = $false } -Update-MgDevice -DeviceId $deviceId -BodyParameter $params -``` -This example shows how to use the Update-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Update-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Update-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Write extensionAttributes on a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - AccountEnabled = $false } -Update-MgDevice -DeviceId $deviceId -BodyParameter $params -``` -This example shows how to use the Update-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Update-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDomain.md index 1ff91394b8f..a3e682f52ca 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgDomain.md @@ -1,14 +1,17 @@ -### Example 1: Using the Update-MgDomain Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - IsDefault = $true - SupportedServices = @( + isDefault = $true + supportedServices = @( "Email" "OfficeCommunicationsOnline" ) } -Update-MgDomain -DomainId $domainId -BodyParameter $params -``` -This example shows how to use the Update-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgDomain -DomainId $domainId -BodyParameter $params +``` +This example shows how to use the Update-MgDomain Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgOrganization.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgOrganization.md index 5e266c3d37d..cc125809fc9 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgOrganization.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0-beta/Update-MgOrganization.md @@ -1,25 +1,28 @@ -### Example 1: Using the Update-MgOrganization Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - MarketingNotificationEmails = @( + marketingNotificationEmails = @( "marketing@contoso.com" ) - PrivacyProfile = @{ - ContactEmail = "alice@contoso.com" - StatementUrl = "https://contoso.com/privacyStatement" + privacyProfile = @{ + contactEmail = "alice@contoso.com" + statementUrl = "https://contoso.com/privacyStatement" } - SecurityComplianceNotificationMails = @( + securityComplianceNotificationMails = @( "security@contoso.com" ) - SecurityComplianceNotificationPhones = @( + securityComplianceNotificationPhones = @( "(123) 456-7890" ) - TechnicalNotificationMails = @( + technicalNotificationMails = @( "tech@contoso.com" ) } -Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params -``` -This example shows how to use the Update-MgOrganization Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params +``` +This example shows how to use the Update-MgOrganization Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContract.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContract.md index c2d402b792b..4422efae40f 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContract.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgContract.md @@ -1,14 +1,9 @@ -### Example 1: Using the Get-MgContract Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgContract -ContractId $contractId -``` -This example shows how to use the Get-MgContract Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgContract Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgContract -``` -This example shows how to use the Get-MgContract Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgContract -ContractId $contractId +``` +This example shows how to use the Get-MgContract Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDevice.md index e838861d2a7..f8096f2993f 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDevice.md @@ -1,49 +1,25 @@ -### Example 1: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Search "displayName:Android" -CountVariable CountVar -ConsistencyLevel eventual -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -DeviceId $deviceId -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -DeviceId $deviceId -Property "id,extensionAttributes" -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Filter "extensionAttributes/extensionAttribute1 eq 'BYOD-Device'" -CountVariable CountVar -ConsistencyLevel eventual -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Property "id,extensionAttributes" -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 7: Using the Get-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDevice -Filter "startswith(displayName, 'a')" -CountVariable CountVar -Top 1 -Sort "displayName" -ConsistencyLevel eventual -``` -This example shows how to use the Get-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Update the accountEnabled property of a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + accountEnabled = $false +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Get-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Write extensionAttributes on a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Get-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleTemplate.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleTemplate.md index e8e27e057f0..f5847871613 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleTemplate.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgDirectoryRoleTemplate.md @@ -1,14 +1,9 @@ -### Example 1: Using the Get-MgDirectoryRoleTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDirectoryRoleTemplate -DirectoryRoleTemplateId $directoryRoleTemplateId -``` -This example shows how to use the Get-MgDirectoryRoleTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgDirectoryRoleTemplate Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgDirectoryRoleTemplate -``` -This example shows how to use the Get-MgDirectoryRoleTemplate Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDirectoryRoleTemplate -DirectoryRoleTemplateId $directoryRoleTemplateId +``` +This example shows how to use the Get-MgDirectoryRoleTemplate Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgOrganization.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgOrganization.md index bf1a20a58cb..9e5a1cef480 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgOrganization.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Get-MgOrganization.md @@ -1,14 +1,28 @@ -### Example 1: Using the Get-MgOrganization Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgOrganization -OrganizationId $organizationId -``` -This example shows how to use the Get-MgOrganization Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgOrganization Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgOrganization -``` -This example shows how to use the Get-MgOrganization Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + marketingNotificationEmails = @( + "marketing@contoso.com" + ) + privacyProfile = @{ + contactEmail = "alice@contoso.com" + statementUrl = "https://contoso.com/privacyStatement" + } + securityComplianceNotificationMails = @( + "security@contoso.com" + ) + securityComplianceNotificationPhones = @( + "(123) 456-7890" + ) + technicalNotificationMails = @( + "tech@contoso.com" + ) +} + +Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params +``` +This example shows how to use the Get-MgOrganization Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgContact.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgContact.md index 44d04424b5e..ac9ce6aa967 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgContact.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgContact.md @@ -20,7 +20,7 @@ This example shows how to use the New-MgContact Cmdlet. ```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement -Get-MgContact -Search "displayName:wa" -CountVariable CountVar -ConsistencyLevel eventual +Get-MgContact -Search '"displayName:wa"' -CountVariable CountVar -ConsistencyLevel eventual ``` This example shows how to use the New-MgContact Cmdlet. To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDevice.md index 6cc559d78b2..2d8e030a3cd 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDevice.md @@ -1,20 +1,45 @@ -### Example 1: Using the New-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - AccountEnabled = $false - AlternativeSecurityIds = @( - @{ - Type = 2 - Key = [System.Text.Encoding]::ASCII.GetBytes("base64Y3YxN2E1MWFlYw==") - } - ) - DeviceId = "4c299165-6e8f-4b45-a5ba-c5d250a707ff" - DisplayName = "Test device" - OperatingSystem = "linux" - OperatingSystemVersion = "1" -} -New-MgDevice -BodyParameter $params -``` -This example shows how to use the New-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Property "id,extensionAttributes" +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Filter "startswith(displayName, 'a')" -CountVariable CountVar -Top 1 -Sort "displayName" -ConsistencyLevel eventual +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 4: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Search '"displayName:Android"' -CountVariable CountVar -ConsistencyLevel eventual +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 5: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDevice -Filter "extensionAttributes/extensionAttribute1 eq 'BYOD-Device'" -CountVariable CountVar -ConsistencyLevel eventual +``` +This example shows how to use the New-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRole.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRole.md index 14ef0502506..700c605d095 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRole.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDirectoryRole.md @@ -1,10 +1,9 @@ -### Example 1: Using the New-MgDirectoryRole Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - RoleTemplateId = "fe930be7-5e62-47db-91af-98c3a49a38b1" -} -New-MgDirectoryRole -BodyParameter $params -``` -This example shows how to use the New-MgDirectoryRole Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDirectoryRole +``` +This example shows how to use the New-MgDirectoryRole Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDomain.md index f88d172ca2d..d3b157bbca2 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/New-MgDomain.md @@ -1,10 +1,9 @@ -### Example 1: Using the New-MgDomain Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - Id = "contoso.com" -} -New-MgDomain -BodyParameter $params -``` -This example shows how to use the New-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Get-MgDomain +``` +This example shows how to use the New-MgDomain Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDevice.md index f95ac3817a5..af6825a977b 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDevice.md @@ -1,7 +1,25 @@ -### Example 1: Using the Remove-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Remove-MgDevice -DeviceId $deviceId -``` -This example shows how to use the Remove-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Update the accountEnabled property of a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + accountEnabled = $false +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Remove-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Write extensionAttributes on a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ +} + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Remove-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDomain.md index 9a3adcac02e..1d3da9dd709 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgDomain.md @@ -1,7 +1,17 @@ -### Example 1: Using the Remove-MgDomain Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -Remove-MgDomain -DomainId $domainId -``` -This example shows how to use the Remove-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + +$params = @{ + isDefault = $true + supportedServices = @( + "Email" + "OfficeCommunicationsOnline" + ) +} + +Update-MgDomain -DomainId $domainId -BodyParameter $params +``` +This example shows how to use the Remove-MgDomain Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgOrganization.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgOrganization.md index 8e4c8307f64..d83f2afe816 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgOrganization.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Remove-MgOrganization.md @@ -3,20 +3,20 @@ ```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement $params = @{ - MarketingNotificationEmails = @( + marketingNotificationEmails = @( "marketing@contoso.com" ) - PrivacyProfile = @{ - ContactEmail = "alice@contoso.com" - StatementUrl = "https://contoso.com/privacyStatement" + privacyProfile = @{ + contactEmail = "alice@contoso.com" + statementUrl = "https://contoso.com/privacyStatement" } - SecurityComplianceNotificationMails = @( + securityComplianceNotificationMails = @( "security@contoso.com" ) - SecurityComplianceNotificationPhones = @( + securityComplianceNotificationPhones = @( "(123) 456-7890" ) - TechnicalNotificationMails = @( + technicalNotificationMails = @( "tech@contoso.com" ) } diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDevice.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDevice.md index 0cdd079c27d..f12d4d22d39 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDevice.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDevice.md @@ -1,19 +1,25 @@ -### Example 1: Using the Update-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Update the accountEnabled property of a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ + accountEnabled = $false } -Update-MgDevice -DeviceId $deviceId -BodyParameter $params -``` -This example shows how to use the Update-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Update-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Update-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Write extensionAttributes on a device + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - AccountEnabled = $false } -Update-MgDevice -DeviceId $deviceId -BodyParameter $params -``` -This example shows how to use the Update-MgDevice Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgDevice -DeviceId $deviceId -BodyParameter $params +``` +This example shows how to use the Update-MgDevice Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDomain.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDomain.md index 1ff91394b8f..a3e682f52ca 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDomain.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgDomain.md @@ -1,14 +1,17 @@ -### Example 1: Using the Update-MgDomain Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - IsDefault = $true - SupportedServices = @( + isDefault = $true + supportedServices = @( "Email" "OfficeCommunicationsOnline" ) } -Update-MgDomain -DomainId $domainId -BodyParameter $params -``` -This example shows how to use the Update-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgDomain -DomainId $domainId -BodyParameter $params +``` +This example shows how to use the Update-MgDomain Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgOrganization.md b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgOrganization.md index 5e266c3d37d..cc125809fc9 100644 --- a/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgOrganization.md +++ b/src/Identity.DirectoryManagement/Identity.DirectoryManagement/examples/v1.0/Update-MgOrganization.md @@ -1,25 +1,28 @@ -### Example 1: Using the Update-MgOrganization Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - MarketingNotificationEmails = @( + marketingNotificationEmails = @( "marketing@contoso.com" ) - PrivacyProfile = @{ - ContactEmail = "alice@contoso.com" - StatementUrl = "https://contoso.com/privacyStatement" + privacyProfile = @{ + contactEmail = "alice@contoso.com" + statementUrl = "https://contoso.com/privacyStatement" } - SecurityComplianceNotificationMails = @( + securityComplianceNotificationMails = @( "security@contoso.com" ) - SecurityComplianceNotificationPhones = @( + securityComplianceNotificationPhones = @( "(123) 456-7890" ) - TechnicalNotificationMails = @( + technicalNotificationMails = @( "tech@contoso.com" ) } -Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params -``` -This example shows how to use the Update-MgOrganization Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params +``` +This example shows how to use the Update-MgOrganization Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgDataPolicyOperation.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgDataPolicyOperation.md index af06a44cfe9..f0a41356992 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgDataPolicyOperation.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgDataPolicyOperation.md @@ -1,7 +1,9 @@ -### Example 1: Using the Get-MgDataPolicyOperation Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Get-MgDataPolicyOperation -DataPolicyOperationId $dataPolicyOperationId -``` -This example shows how to use the Get-MgDataPolicyOperation Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +Get-MgDataPolicyOperation -DataPolicyOperationId $dataPolicyOperationId +``` +This example shows how to use the Get-MgDataPolicyOperation Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgOauth2PermissionGrant.md index 6886116e856..d8d38983b01 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Get-MgOauth2PermissionGrant.md @@ -1,14 +1,13 @@ -### Example 1: Using the Get-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Get-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -``` -This example shows how to use the Get-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Get-MgOauth2PermissionGrant -``` -This example shows how to use the Get-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +$params = @{ + scope = "User.ReadBasic.All Group.ReadWrite.All" +} + +Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params +``` +This example shows how to use the Get-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgInvitation.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgInvitation.md index 89c419d5606..303f7f3b02e 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgInvitation.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgInvitation.md @@ -3,8 +3,8 @@ ```powershell Import-Module Microsoft.Graph.Identity.SignIns $params = @{ - InvitedUserEmailAddress = "admin@fabrikam.com" - InviteRedirectUrl = "https://myapp.contoso.com" + invitedUserEmailAddress = "admin@fabrikam.com" + inviteRedirectUrl = "https://myapp.contoso.com" } New-MgInvitation -BodyParameter $params diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgOauth2PermissionGrant.md index 092a9c0a9b4..96996911849 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/New-MgOauth2PermissionGrant.md @@ -1,15 +1,9 @@ -### Example 1: Using the New-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -$params = @{ - ClientId = "ef969797-201d-4f6b-960c-e9ed5f31dab5" - ConsentType = "AllPrincipals" - ResourceId = "943603e4-e787-4fe9-93d1-e30f749aae39" - Scope = "DelegatedPermissionGrant.ReadWrite.All" - StartTime = [System.DateTime]::Parse("2022-03-17T00:00:00Z") - ExpiryTime = [System.DateTime]::Parse("2023-03-17T00:00:00Z") -} -New-MgOauth2PermissionGrant -BodyParameter $params -``` -This example shows how to use the New-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +Get-MgOauth2PermissionGrant +``` +This example shows how to use the New-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Remove-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Remove-MgOauth2PermissionGrant.md index 9b181d80bb5..24b5d9b3c52 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Remove-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Remove-MgOauth2PermissionGrant.md @@ -1,7 +1,13 @@ -### Example 1: Using the Remove-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Remove-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -``` -This example shows how to use the Remove-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +$params = @{ + scope = "User.ReadBasic.All Group.ReadWrite.All" +} + +Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params +``` +This example shows how to use the Remove-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Update-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Update-MgOauth2PermissionGrant.md index 7a1f2d7b0e7..4e8fca01789 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Update-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0-beta/Update-MgOauth2PermissionGrant.md @@ -1,10 +1,13 @@ -### Example 1: Using the Update-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + $params = @{ - Scope = "User.ReadBasic.All Group.ReadWrite.All" + scope = "User.ReadBasic.All Group.ReadWrite.All" } -Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params -``` -This example shows how to use the Update-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params +``` +This example shows how to use the Update-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgDataPolicyOperation.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgDataPolicyOperation.md index af06a44cfe9..f0a41356992 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgDataPolicyOperation.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgDataPolicyOperation.md @@ -1,7 +1,9 @@ -### Example 1: Using the Get-MgDataPolicyOperation Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Get-MgDataPolicyOperation -DataPolicyOperationId $dataPolicyOperationId -``` -This example shows how to use the Get-MgDataPolicyOperation Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +Get-MgDataPolicyOperation -DataPolicyOperationId $dataPolicyOperationId +``` +This example shows how to use the Get-MgDataPolicyOperation Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgOauth2PermissionGrant.md index 6886116e856..d8d38983b01 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Get-MgOauth2PermissionGrant.md @@ -1,14 +1,13 @@ -### Example 1: Using the Get-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Get-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -``` -This example shows how to use the Get-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Get-MgOauth2PermissionGrant -``` -This example shows how to use the Get-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +$params = @{ + scope = "User.ReadBasic.All Group.ReadWrite.All" +} + +Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params +``` +This example shows how to use the Get-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/New-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/New-MgOauth2PermissionGrant.md index e1d8039ddaa..96996911849 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/New-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/New-MgOauth2PermissionGrant.md @@ -1,13 +1,9 @@ -### Example 1: Using the New-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -$params = @{ - ClientId = "ef969797-201d-4f6b-960c-e9ed5f31dab5" - ConsentType = "AllPrincipals" - ResourceId = "943603e4-e787-4fe9-93d1-e30f749aae39" - Scope = "DelegatedPermissionGrant.ReadWrite.All" -} -New-MgOauth2PermissionGrant -BodyParameter $params -``` -This example shows how to use the New-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +Get-MgOauth2PermissionGrant +``` +This example shows how to use the New-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Remove-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Remove-MgOauth2PermissionGrant.md index 9b181d80bb5..24b5d9b3c52 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Remove-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Remove-MgOauth2PermissionGrant.md @@ -1,7 +1,13 @@ -### Example 1: Using the Remove-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns -Remove-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -``` -This example shows how to use the Remove-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + +$params = @{ + scope = "User.ReadBasic.All Group.ReadWrite.All" +} + +Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params +``` +This example shows how to use the Remove-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Update-MgOauth2PermissionGrant.md b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Update-MgOauth2PermissionGrant.md index 7a1f2d7b0e7..4e8fca01789 100644 --- a/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Update-MgOauth2PermissionGrant.md +++ b/src/Identity.SignIns/Identity.SignIns/examples/v1.0/Update-MgOauth2PermissionGrant.md @@ -1,10 +1,13 @@ -### Example 1: Using the Update-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.SignIns + $params = @{ - Scope = "User.ReadBasic.All Group.ReadWrite.All" + scope = "User.ReadBasic.All Group.ReadWrite.All" } -Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params -``` -This example shows how to use the Update-MgOauth2PermissionGrant Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgOauth2PermissionGrant -OAuth2PermissionGrantId $oAuth2PermissionGrantId -BodyParameter $params +``` +This example shows how to use the Update-MgOauth2PermissionGrant Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Get-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Get-MgSchemaExtension.md index 463677ebfe3..611fd1a87a7 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Get-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Get-MgSchemaExtension.md @@ -1,14 +1,31 @@ -### Example 1: Using the Get-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -Get-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -``` -This example shows how to use the Get-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -Get-MgSchemaExtension -Filter "id eq 'graphlearn_test'" -``` -This example shows how to use the Get-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + +$params = @{ + owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" + properties = @( + @{ + name = "courseId" + type = "Integer" + } + @{ + name = "courseName" + type = "String" + } + @{ + name = "courseType" + type = "String" + } + @{ + name = "courseSupervisors" + type = "String" + } + ) +} + +Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params +``` +This example shows how to use the Get-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/New-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/New-MgSchemaExtension.md index 369d52f1ca4..afe4a9fdf56 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/New-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/New-MgSchemaExtension.md @@ -1,85 +1,9 @@ -### Example 1: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Id = "graphlearn_courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( - "Group" - ) - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - ) -} -New-MgSchemaExtension -BodyParameter $params -``` -This example shows how to use the New-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Id = "courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( - "Group" - ) - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - ) -} -New-MgSchemaExtension -BodyParameter $params -``` -This example shows how to use the New-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Id = "courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( - "Group" - ) - Owner = "50897f70-a455-4adf-87bc-4cf17091d5ac" - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - ) -} -New-MgSchemaExtension -BodyParameter $params -``` -This example shows how to use the New-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + +Get-MgSchemaExtension -Filter "id eq 'graphlearn_test'" +``` +This example shows how to use the New-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Remove-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Remove-MgSchemaExtension.md index 5fbf9f8da95..a8d472e2e87 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Remove-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Remove-MgSchemaExtension.md @@ -1,7 +1,31 @@ -### Example 1: Using the Remove-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -Remove-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -``` -This example shows how to use the Remove-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + +$params = @{ + owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" + properties = @( + @{ + name = "courseId" + type = "Integer" + } + @{ + name = "courseName" + type = "String" + } + @{ + name = "courseType" + type = "String" + } + @{ + name = "courseSupervisors" + type = "String" + } + ) +} + +Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params +``` +This example shows how to use the Remove-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Update-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Update-MgSchemaExtension.md index 961a8eb0e44..b580c68686f 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Update-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0-beta/Update-MgSchemaExtension.md @@ -1,56 +1,31 @@ -### Example 1: Using the Update-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + $params = @{ - Owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" - Properties = @( + owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" + properties = @( @{ - Name = "courseId" - Type = "Integer" + name = "courseId" + type = "Integer" } @{ - Name = "courseName" - Type = "String" + name = "courseName" + type = "String" } @{ - Name = "courseType" - Type = "String" + name = "courseType" + type = "String" } @{ - Name = "courseSupervisors" - Type = "String" + name = "courseSupervisors" + type = "String" } ) } -Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params -``` -This example shows how to use the Update-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Update-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - @{ - Name = "courseSupervisors" - Type = "String" - } - ) -} -Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params -``` -This example shows how to use the Update-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params +``` +This example shows how to use the Update-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md index 463677ebfe3..611fd1a87a7 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md @@ -1,14 +1,31 @@ -### Example 1: Using the Get-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -Get-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -``` -This example shows how to use the Get-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -Get-MgSchemaExtension -Filter "id eq 'graphlearn_test'" -``` -This example shows how to use the Get-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + +$params = @{ + owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" + properties = @( + @{ + name = "courseId" + type = "Integer" + } + @{ + name = "courseName" + type = "String" + } + @{ + name = "courseType" + type = "String" + } + @{ + name = "courseSupervisors" + type = "String" + } + ) +} + +Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params +``` +This example shows how to use the Get-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md index 369d52f1ca4..afe4a9fdf56 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md @@ -1,85 +1,9 @@ -### Example 1: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Id = "graphlearn_courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( - "Group" - ) - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - ) -} -New-MgSchemaExtension -BodyParameter $params -``` -This example shows how to use the New-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Id = "courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( - "Group" - ) - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - ) -} -New-MgSchemaExtension -BodyParameter $params -``` -This example shows how to use the New-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Id = "courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( - "Group" - ) - Owner = "50897f70-a455-4adf-87bc-4cf17091d5ac" - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - ) -} -New-MgSchemaExtension -BodyParameter $params -``` -This example shows how to use the New-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + +Get-MgSchemaExtension -Filter "id eq 'graphlearn_test'" +``` +This example shows how to use the New-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md index 5fbf9f8da95..a8d472e2e87 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md @@ -1,7 +1,31 @@ -### Example 1: Using the Remove-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -Remove-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -``` -This example shows how to use the Remove-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + +$params = @{ + owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" + properties = @( + @{ + name = "courseId" + type = "Integer" + } + @{ + name = "courseName" + type = "String" + } + @{ + name = "courseType" + type = "String" + } + @{ + name = "courseSupervisors" + type = "String" + } + ) +} + +Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params +``` +This example shows how to use the Remove-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Update-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Update-MgSchemaExtension.md index 961a8eb0e44..b580c68686f 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Update-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Update-MgSchemaExtension.md @@ -1,56 +1,31 @@ -### Example 1: Using the Update-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + $params = @{ - Owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" - Properties = @( + owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" + properties = @( @{ - Name = "courseId" - Type = "Integer" + name = "courseId" + type = "Integer" } @{ - Name = "courseName" - Type = "String" + name = "courseName" + type = "String" } @{ - Name = "courseType" - Type = "String" + name = "courseType" + type = "String" } @{ - Name = "courseSupervisors" - Type = "String" + name = "courseSupervisors" + type = "String" } ) } -Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params -``` -This example shows how to use the Update-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Update-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions -$params = @{ - Owner = "ef4cb9a8-97c3-4ca7-854b-5cb5ced376fa" - Properties = @( - @{ - Name = "courseId" - Type = "Integer" - } - @{ - Name = "courseName" - Type = "String" - } - @{ - Name = "courseType" - Type = "String" - } - @{ - Name = "courseSupervisors" - Type = "String" - } - ) -} -Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params -``` -This example shows how to use the Update-MgSchemaExtension Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgSchemaExtension -SchemaExtensionId $schemaExtensionId -BodyParameter $params +``` +This example shows how to use the Update-MgSchemaExtension Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Sites/Sites/examples/v1.0-beta/Get-MgSite.md b/src/Sites/Sites/examples/v1.0-beta/Get-MgSite.md index bece80c7c30..c00ee4de9ed 100644 --- a/src/Sites/Sites/examples/v1.0-beta/Get-MgSite.md +++ b/src/Sites/Sites/examples/v1.0-beta/Get-MgSite.md @@ -1,42 +1,9 @@ -### Example 1: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -SiteId $siteId -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -Search "{query}" -OutFile $outFileId -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -Search "{query}" -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -Property "siteCollection,webUrl" -Filter "siteCollection/root ne null" -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -OutFile $outFileId -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Sites + +Get-MgSite -SiteId $siteId +``` +This example shows how to use the Get-MgSite Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Sites/Sites/examples/v1.0/Get-MgSite.md b/src/Sites/Sites/examples/v1.0/Get-MgSite.md index d06a8565629..c00ee4de9ed 100644 --- a/src/Sites/Sites/examples/v1.0/Get-MgSite.md +++ b/src/Sites/Sites/examples/v1.0/Get-MgSite.md @@ -1,21 +1,9 @@ -### Example 1: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -SiteId $siteId -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -Search "{query}" -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgSite Cmdlet -```powershell -Import-Module Microsoft.Graph.Sites -Get-MgSite -Search "{query}" -OutFile $outFileId -``` -This example shows how to use the Get-MgSite Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Sites + +Get-MgSite -SiteId $siteId +``` +This example shows how to use the Get-MgSite Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0-beta/Get-MgChat.md b/src/Teams/Teams/examples/v1.0-beta/Get-MgChat.md index b23c9eb41cb..a61a1a0d739 100644 --- a/src/Teams/Teams/examples/v1.0-beta/Get-MgChat.md +++ b/src/Teams/Teams/examples/v1.0-beta/Get-MgChat.md @@ -1,35 +1,13 @@ -### Example 1: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -ExpandProperty "members" -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ExpandProperty "lastMessagePreview" -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -Sort "lastMessagePreview/createdDateTime desc" -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + topic = "Group chat title update" +} + +Update-MgChat -ChatId $chatId -BodyParameter $params +``` +This example shows how to use the Get-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0-beta/Get-MgTeam.md b/src/Teams/Teams/examples/v1.0-beta/Get-MgTeam.md index 07f90af094c..f929a9b4331 100644 --- a/src/Teams/Teams/examples/v1.0-beta/Get-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0-beta/Get-MgTeam.md @@ -1,35 +1,23 @@ -### Example 1: Using the Get-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgTeam -TeamId $teamId -``` -This example shows how to use the Get-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgTeam -Filter "displayName eq 'A Contoso Team'" -Property "id,description" -``` -This example shows how to use the Get-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgTeam -Filter "startswith(displayName, 'A')" -Top 2 -``` -This example shows how to use the Get-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the Get-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgTeam -``` -This example shows how to use the Get-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the Get-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgTeam -Filter "displayName eq 'A Contoso Team'" -Property "id,description" -OutFile $outFileId -``` -This example shows how to use the Get-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + memberSettings = @{ + allowCreateUpdateChannels = $true + } + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true + } + funSettings = @{ + allowGiphy = $true + giphyContentRating = "strict" + } +} + +Update-MgTeam -TeamId $teamId -BodyParameter $params +``` +This example shows how to use the Get-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0-beta/New-MgChat.md b/src/Teams/Teams/examples/v1.0-beta/New-MgChat.md index 2b12d55cd67..9725d77c5d1 100644 --- a/src/Teams/Teams/examples/v1.0-beta/New-MgChat.md +++ b/src/Teams/Teams/examples/v1.0-beta/New-MgChat.md @@ -1,212 +1,36 @@ -### Example 1: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('3626a173-f2bc-4883-bcf7-01514c3bfb82')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "guest" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8ba98gf6-7fc2-4eb2-c7f2-aef9f21fd98g')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "guest" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8ba98gf6-7fc2-4eb2-c7f2-aef9f21fd98g')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" - TenantId = "4dc1fe35-8ac6-4f0d-904a-7ebcd364bea1" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('jacob@contoso.com')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('alex@contoso.com')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 7: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" - } - ) - InstalledApps = @( - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/beta/appCatalogs/teamsApps/05F59CEC-A742-4A50-A62E-202A57E478A4" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: List all chats + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgUserChat -UserId $userId +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: List all chats along with the members of each chat + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgUserChat -UserId $userId -ExpandProperty "members" +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: List all chats in order of the most to least recent chat messages + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgChat -Sort "lastMessagePreview/createdDateTime desc" +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 4: List chats along with the preview of the last message sent in the chat + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgChat -ExpandProperty "lastMessagePreview" +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0-beta/New-MgTeam.md b/src/Teams/Teams/examples/v1.0-beta/New-MgTeam.md index 4a0770b90bd..ae304e4fb59 100644 --- a/src/Teams/Teams/examples/v1.0-beta/New-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0-beta/New-MgTeam.md @@ -1,236 +1,257 @@ -### Example 1: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')" - "Group@odata.bind" = "https://graph.microsoft.com/beta/groups('dbd8de4f-5d47-48da-87f1-594bed003375')" - Channels = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + displayName = "My Sample Team" + description = "My Sample Team???s Description" +} + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + displayName = "My Sample Team" + description = "My Sample Team???s Description" + members = @( @{ - DisplayName = "Class Announcements 📢" - IsFavoriteByDefault = $true + "@odata.type" = "#microsoft.graph.aadUserConversationMember" + roles = @( + "owner" + ) + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('0040b377-61d8-43db-94f5-81374122dc7e')" } + ) +} + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + visibility = "Private" + displayName = "Sample Engineering Team" + description = "This is a sample engineering team, used to showcase the range of properties supported by this API" + channels = @( @{ - DisplayName = "Homework ðŸ‹ï¸" - IsFavoriteByDefault = $true + displayName = "Announcements ????" + isFavoriteByDefault = $true + description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements." + } + @{ + displayName = "Training ???????" + isFavoriteByDefault = $true + description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs." + tabs = @( + @{ + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')" + displayName = "A Pinned Website" + configuration = @{ + contentUrl = "https://learn.microsoft.com/microsoftteams/microsoft-teams" + } + } + @{ + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')" + displayName = "A Pinned YouTube Video" + configuration = @{ + contentUrl = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ" + websiteUrl = "https://www.youtube.com/watch?v=X8krAMdGvCQ" + } + } + ) + } + @{ + displayName = "Planning ???? " + description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." + isFavoriteByDefault = $false + } + @{ + displayName = "Issues and Feedback ????" + description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." } ) - MemberSettings = @{ - AllowCreateUpdateChannels = $false - AllowDeleteChannels = $false - AllowAddRemoveApps = $false - AllowCreateUpdateRemoveTabs = $false - AllowCreateUpdateRemoveConnectors = $false + memberSettings = @{ + allowCreateUpdateChannels = $true + allowDeleteChannels = $true + allowAddRemoveApps = $true + allowCreateUpdateRemoveTabs = $true + allowCreateUpdateRemoveConnectors = $true + } + guestSettings = @{ + allowCreateUpdateChannels = $false + allowDeleteChannels = $false } - InstalledApps = @( + funSettings = @{ + allowGiphy = $true + giphyContentRating = "Moderate" + allowStickersAndMemes = $true + allowCustomMemes = $true + } + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true + allowOwnerDeleteMessages = $true + allowTeamMentions = $true + allowChannelMentions = $true + } + installedApps = @( @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" } @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 4: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('educationClass')" - DisplayName = "My Class Team" - Description = "My Class Team’s Description" + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + "group@odata.bind" = "https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')" } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 5: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('educationClass')" - DisplayName = "My Class Team" - Description = "My Class Team’s Description" - Channels = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + "group@odata.bind" = "https://graph.microsoft.com/v1.0/groups('dbd8de4f-5d47-48da-87f1-594bed003375')" + channels = @( @{ - DisplayName = "Class Announcements 📢" - IsFavoriteByDefault = $true + displayName = "Class Announcements ????" + isFavoriteByDefault = $true } @{ - DisplayName = "Homework ðŸ‹ï¸" - IsFavoriteByDefault = $true + displayName = "Homework ???????" + isFavoriteByDefault = $true } ) - MemberSettings = @{ - AllowCreateUpdateChannels = $false - AllowDeleteChannels = $false - AllowAddRemoveApps = $false - AllowCreateUpdateRemoveTabs = $false - AllowCreateUpdateRemoveConnectors = $false + memberSettings = @{ + allowCreateUpdateChannels = $false + allowDeleteChannels = $false + allowAddRemoveApps = $false + allowCreateUpdateRemoveTabs = $false + allowCreateUpdateRemoveConnectors = $false } - InstalledApps = @( + installedApps = @( @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" } @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 6: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')" - "Group@odata.bind" = "https://graph.microsoft.com/beta/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')" + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')" + displayName = "My Class Team" + description = "My Class Team???s Description" } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 7: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')" - Visibility = "Private" - DisplayName = "Sample Engineering Team" - Description = "This is a sample engineering team, used to showcase the range of properties supported by this API" - Channels = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')" + displayName = "My Class Team" + description = "My Class Team???s Description" + channels = @( @{ - DisplayName = "Announcements 📢" - IsFavoriteByDefault = $true - Description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements." + displayName = "Class Announcements ????" + isFavoriteByDefault = $true } @{ - DisplayName = "Training ðŸ‹ï¸" - IsFavoriteByDefault = $true - Description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs." - Tabs = @( - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')" - DisplayName = "A Pinned Website" - Configuration = @{ - ContentUrl = "https://docs.microsoft.com/microsoftteams/microsoft-teams" - } - } - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')" - DisplayName = "A Pinned YouTube Video" - Configuration = @{ - ContentUrl = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ" - WebsiteUrl = "https://www.youtube.com/watch?v=X8krAMdGvCQ" - } - } - ) - } - @{ - DisplayName = "Planning 📅 " - Description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." - IsFavoriteByDefault = $false - } - @{ - DisplayName = "Issues and Feedback ðŸž" - Description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." + displayName = "Homework ???????" + isFavoriteByDefault = $true } ) - MemberSettings = @{ - AllowCreateUpdateChannels = $true - AllowDeleteChannels = $true - AllowAddRemoveApps = $true - AllowCreateUpdateRemoveTabs = $true - AllowCreateUpdateRemoveConnectors = $true - } - GuestSettings = @{ - AllowCreateUpdateChannels = $false - AllowDeleteChannels = $false - } - FunSettings = @{ - AllowGiphy = $true - GiphyContentRating = "Moderate" - AllowStickersAndMemes = $true - AllowCustomMemes = $true + memberSettings = @{ + allowCreateUpdateChannels = $false + allowDeleteChannels = $false + allowAddRemoveApps = $false + allowCreateUpdateRemoveTabs = $false + allowCreateUpdateRemoveConnectors = $false } - MessagingSettings = @{ - AllowUserEditMessages = $true - AllowUserDeleteMessages = $true - AllowOwnerDeleteMessages = $true - AllowTeamMentions = $true - AllowChannelMentions = $true - } - DiscoverySettings = @{ - ShowInTeamsSearchAndSuggestions = $true - } - InstalledApps = @( - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" - } + installedApps = @( @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" } - ) -} -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')" - DisplayName = "My Sample Team" - Description = "My Sample Team’s Description" - Members = @( @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('0040b377-61d8-43db-94f5-81374122dc7e')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 7: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')" - DisplayName = "My Sample Team" - Description = "My Sample Team’s Description" -} -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 8: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 8: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')" - DisplayName = "My Sample Team" - Description = "My Sample Team’s Description" - Members = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + displayName = "My Sample Team" + description = "My Sample Team???s Description" + members = @( @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/beta/users('jacob@contoso.com')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0-beta/Remove-MgChat.md b/src/Teams/Teams/examples/v1.0-beta/Remove-MgChat.md index 5692b293885..b7f64b685e6 100644 --- a/src/Teams/Teams/examples/v1.0-beta/Remove-MgChat.md +++ b/src/Teams/Teams/examples/v1.0-beta/Remove-MgChat.md @@ -3,7 +3,7 @@ ```powershell Import-Module Microsoft.Graph.Teams $params = @{ - Topic = "Group chat title update" + topic = "Group chat title update" } Update-MgChat -ChatId $chatId -BodyParameter $params diff --git a/src/Teams/Teams/examples/v1.0-beta/Remove-MgTeam.md b/src/Teams/Teams/examples/v1.0-beta/Remove-MgTeam.md index d987c0f6911..eba29921540 100644 --- a/src/Teams/Teams/examples/v1.0-beta/Remove-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0-beta/Remove-MgTeam.md @@ -3,16 +3,16 @@ ```powershell Import-Module Microsoft.Graph.Teams $params = @{ - MemberSettings = @{ - AllowCreateUpdateChannels = $true + memberSettings = @{ + allowCreateUpdateChannels = $true } - MessagingSettings = @{ - AllowUserEditMessages = $true - AllowUserDeleteMessages = $true + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true } - FunSettings = @{ - AllowGiphy = $true - GiphyContentRating = "strict" + funSettings = @{ + allowGiphy = $true + giphyContentRating = "strict" } } diff --git a/src/Teams/Teams/examples/v1.0-beta/Update-MgChat.md b/src/Teams/Teams/examples/v1.0-beta/Update-MgChat.md index 7d3d89e4caf..332cc75c2b0 100644 --- a/src/Teams/Teams/examples/v1.0-beta/Update-MgChat.md +++ b/src/Teams/Teams/examples/v1.0-beta/Update-MgChat.md @@ -1,10 +1,13 @@ -### Example 1: Using the Update-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - Topic = "Group chat title update" + topic = "Group chat title update" } -Update-MgChat -ChatId $chatId -BodyParameter $params -``` -This example shows how to use the Update-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgChat -ChatId $chatId -BodyParameter $params +``` +This example shows how to use the Update-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0-beta/Update-MgTeam.md b/src/Teams/Teams/examples/v1.0-beta/Update-MgTeam.md index a717cb3ca28..41638a9e200 100644 --- a/src/Teams/Teams/examples/v1.0-beta/Update-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0-beta/Update-MgTeam.md @@ -1,24 +1,23 @@ -### Example 1: Using the Update-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - IsMembershipLimitedToOwners = $true - MemberSettings = @{ - AllowCreateUpdateChannels = $true + memberSettings = @{ + allowCreateUpdateChannels = $true } - MessagingSettings = @{ - AllowUserEditMessages = $true - AllowUserDeleteMessages = $true + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true } - FunSettings = @{ - AllowGiphy = $true - GiphyContentRating = "strict" - } - DiscoverySettings = @{ - ShowInTeamsSearchAndSuggestions = $true + funSettings = @{ + allowGiphy = $true + giphyContentRating = "strict" } } -Update-MgTeam -TeamId $teamId -BodyParameter $params -``` -This example shows how to use the Update-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgTeam -TeamId $teamId -BodyParameter $params +``` +This example shows how to use the Update-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0/Get-MgChat.md b/src/Teams/Teams/examples/v1.0/Get-MgChat.md index 7aba3b16c0c..a61a1a0d739 100644 --- a/src/Teams/Teams/examples/v1.0/Get-MgChat.md +++ b/src/Teams/Teams/examples/v1.0/Get-MgChat.md @@ -1,28 +1,13 @@ -### Example 1: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -ExpandProperty "members" -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the Get-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgChat -Sort "lastMessagePreview/createdDateTime desc" -``` -This example shows how to use the Get-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + topic = "Group chat title update" +} + +Update-MgChat -ChatId $chatId -BodyParameter $params +``` +This example shows how to use the Get-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0/Get-MgTeam.md b/src/Teams/Teams/examples/v1.0/Get-MgTeam.md index c5775d5c57f..f929a9b4331 100644 --- a/src/Teams/Teams/examples/v1.0/Get-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0/Get-MgTeam.md @@ -1,7 +1,23 @@ -### Example 1: Using the Get-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -Get-MgTeam -TeamId $teamId -``` -This example shows how to use the Get-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + memberSettings = @{ + allowCreateUpdateChannels = $true + } + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true + } + funSettings = @{ + allowGiphy = $true + giphyContentRating = "strict" + } +} + +Update-MgTeam -TeamId $teamId -BodyParameter $params +``` +This example shows how to use the Get-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0/New-MgChat.md b/src/Teams/Teams/examples/v1.0/New-MgChat.md index 37c4169c6c9..9725d77c5d1 100644 --- a/src/Teams/Teams/examples/v1.0/New-MgChat.md +++ b/src/Teams/Teams/examples/v1.0/New-MgChat.md @@ -1,181 +1,36 @@ -### Example 1: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "guest" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8ba98gf6-7fc2-4eb2-c7f2-aef9f21fd98g')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "guest" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8ba98gf6-7fc2-4eb2-c7f2-aef9f21fd98g')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('3626a173-f2bc-4883-bcf7-01514c3bfb82')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" - TenantId = "4dc1fe35-8ac6-4f0d-904a-7ebcd364bea1" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - ChatType = "oneOnOne" - Members = @( - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')" - } - @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('alex@contoso.com')" - } - ) -} -New-MgChat -BodyParameter $params -``` -This example shows how to use the New-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +### Example 1: List all chats + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgUserChat -UserId $userId +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: List all chats along with the members of each chat + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgUserChat -UserId $userId -ExpandProperty "members" +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: List all chats in order of the most to least recent chat messages + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgChat -Sort "lastMessagePreview/createdDateTime desc" +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 4: List chats along with the preview of the last message sent in the chat + +```powershell Import-Module Microsoft.Graph.Teams + +Get-MgChat -ExpandProperty "lastMessagePreview" +``` +This example shows how to use the New-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0/New-MgTeam.md b/src/Teams/Teams/examples/v1.0/New-MgTeam.md index b761ac785bf..ae304e4fb59 100644 --- a/src/Teams/Teams/examples/v1.0/New-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0/New-MgTeam.md @@ -1,233 +1,257 @@ -### Example 1: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" - "Group@odata.bind" = "https://graph.microsoft.com/v1.0/groups('dbd8de4f-5d47-48da-87f1-594bed003375')" - Channels = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + displayName = "My Sample Team" + description = "My Sample Team???s Description" +} + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 2: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + displayName = "My Sample Team" + description = "My Sample Team???s Description" + members = @( + @{ + "@odata.type" = "#microsoft.graph.aadUserConversationMember" + roles = @( + "owner" + ) + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('0040b377-61d8-43db-94f5-81374122dc7e')" + } + ) +} + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 3: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + +$params = @{ + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + visibility = "Private" + displayName = "Sample Engineering Team" + description = "This is a sample engineering team, used to showcase the range of properties supported by this API" + channels = @( + @{ + displayName = "Announcements ????" + isFavoriteByDefault = $true + description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements." + } @{ - DisplayName = "Class Announcements 📢" - IsFavoriteByDefault = $true + displayName = "Training ???????" + isFavoriteByDefault = $true + description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs." + tabs = @( + @{ + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')" + displayName = "A Pinned Website" + configuration = @{ + contentUrl = "https://learn.microsoft.com/microsoftteams/microsoft-teams" + } + } + @{ + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')" + displayName = "A Pinned YouTube Video" + configuration = @{ + contentUrl = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ" + websiteUrl = "https://www.youtube.com/watch?v=X8krAMdGvCQ" + } + } + ) + } + @{ + displayName = "Planning ???? " + description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." + isFavoriteByDefault = $false } @{ - DisplayName = "Homework ðŸ‹ï¸" - IsFavoriteByDefault = $true + displayName = "Issues and Feedback ????" + description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." } ) - MemberSettings = @{ - AllowCreateUpdateChannels = $false - AllowDeleteChannels = $false - AllowAddRemoveApps = $false - AllowCreateUpdateRemoveTabs = $false - AllowCreateUpdateRemoveConnectors = $false + memberSettings = @{ + allowCreateUpdateChannels = $true + allowDeleteChannels = $true + allowAddRemoveApps = $true + allowCreateUpdateRemoveTabs = $true + allowCreateUpdateRemoveConnectors = $true + } + guestSettings = @{ + allowCreateUpdateChannels = $false + allowDeleteChannels = $false + } + funSettings = @{ + allowGiphy = $true + giphyContentRating = "Moderate" + allowStickersAndMemes = $true + allowCustomMemes = $true + } + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true + allowOwnerDeleteMessages = $true + allowTeamMentions = $true + allowChannelMentions = $true } - InstalledApps = @( + installedApps = @( @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" } @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 2: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 4: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')" - DisplayName = "My Class Team" - Description = "My Class Team’s Description" + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + "group@odata.bind" = "https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')" } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 3: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 5: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')" - DisplayName = "My Class Team" - Description = "My Class Team’s Description" - Channels = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + "group@odata.bind" = "https://graph.microsoft.com/v1.0/groups('dbd8de4f-5d47-48da-87f1-594bed003375')" + channels = @( @{ - DisplayName = "Class Announcements 📢" - IsFavoriteByDefault = $true + displayName = "Class Announcements ????" + isFavoriteByDefault = $true } @{ - DisplayName = "Homework ðŸ‹ï¸" - IsFavoriteByDefault = $true + displayName = "Homework ???????" + isFavoriteByDefault = $true } ) - MemberSettings = @{ - AllowCreateUpdateChannels = $false - AllowDeleteChannels = $false - AllowAddRemoveApps = $false - AllowCreateUpdateRemoveTabs = $false - AllowCreateUpdateRemoveConnectors = $false + memberSettings = @{ + allowCreateUpdateChannels = $false + allowDeleteChannels = $false + allowAddRemoveApps = $false + allowCreateUpdateRemoveTabs = $false + allowCreateUpdateRemoveConnectors = $false } - InstalledApps = @( + installedApps = @( @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" } @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 4: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 6: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" - "Group@odata.bind" = "https://graph.microsoft.com/v1.0/groups('71392b2f-1765-406e-86af-5907d9bdb2ab')" + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')" + displayName = "My Class Team" + description = "My Class Team???s Description" } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 5: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 7: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" - Visibility = "Private" - DisplayName = "Sample Engineering Team" - Description = "This is a sample engineering team, used to showcase the range of properties supported by this API" - Channels = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')" + displayName = "My Class Team" + description = "My Class Team???s Description" + channels = @( @{ - DisplayName = "Announcements 📢" - IsFavoriteByDefault = $true - Description = "This is a sample announcements channel that is favorited by default. Use this channel to make important team, product, and service announcements." + displayName = "Class Announcements ????" + isFavoriteByDefault = $true } @{ - DisplayName = "Training ðŸ‹ï¸" - IsFavoriteByDefault = $true - Description = "This is a sample training channel, that is favorited by default, and contains an example of pinned website and YouTube tabs." - Tabs = @( - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')" - DisplayName = "A Pinned Website" - Configuration = @{ - ContentUrl = "https://docs.microsoft.com/microsoftteams/microsoft-teams" - } - } - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.youtube')" - DisplayName = "A Pinned YouTube Video" - Configuration = @{ - ContentUrl = "https://tabs.teams.microsoft.com/Youtube/Home/YoutubeTab?videoId=X8krAMdGvCQ" - WebsiteUrl = "https://www.youtube.com/watch?v=X8krAMdGvCQ" - } - } - ) - } - @{ - DisplayName = "Planning 📅 " - Description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." - IsFavoriteByDefault = $false - } - @{ - DisplayName = "Issues and Feedback ðŸž" - Description = "This is a sample of a channel that is not favorited by default, these channels will appear in the more channels overflow menu." + displayName = "Homework ???????" + isFavoriteByDefault = $true } ) - MemberSettings = @{ - AllowCreateUpdateChannels = $true - AllowDeleteChannels = $true - AllowAddRemoveApps = $true - AllowCreateUpdateRemoveTabs = $true - AllowCreateUpdateRemoveConnectors = $true - } - GuestSettings = @{ - AllowCreateUpdateChannels = $false - AllowDeleteChannels = $false + memberSettings = @{ + allowCreateUpdateChannels = $false + allowDeleteChannels = $false + allowAddRemoveApps = $false + allowCreateUpdateRemoveTabs = $false + allowCreateUpdateRemoveConnectors = $false } - FunSettings = @{ - AllowGiphy = $true - GiphyContentRating = "Moderate" - AllowStickersAndMemes = $true - AllowCustomMemes = $true - } - MessagingSettings = @{ - AllowUserEditMessages = $true - AllowUserDeleteMessages = $true - AllowOwnerDeleteMessages = $true - AllowTeamMentions = $true - AllowChannelMentions = $true - } - InstalledApps = @( - @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" - } + installedApps = @( @{ - "TeamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.vsts')" } - ) -} -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 6: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" - DisplayName = "My Sample Team" - Description = "My Sample Team’s Description" - Members = @( @{ - "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "owner" - ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('0040b377-61d8-43db-94f5-81374122dc7e')" + "teamsApp@odata.bind" = "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('1542629c-01b3-4a6d-8f76-1938b779e48d')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 7: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams -$params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" - DisplayName = "My Sample Team" - Description = "My Sample Team’s Description" -} -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). -### Example 8: Using the New-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +### Example 8: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - "Template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" - DisplayName = "My Sample Team" - Description = "My Sample Team’s Description" - Members = @( + "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('standard')" + displayName = "My Sample Team" + description = "My Sample Team???s Description" + members = @( @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')" } ) } -New-MgTeam -BodyParameter $params -``` -This example shows how to use the New-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +New-MgTeam -BodyParameter $params +``` +This example shows how to use the New-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0/Remove-MgChat.md b/src/Teams/Teams/examples/v1.0/Remove-MgChat.md index 5692b293885..b7f64b685e6 100644 --- a/src/Teams/Teams/examples/v1.0/Remove-MgChat.md +++ b/src/Teams/Teams/examples/v1.0/Remove-MgChat.md @@ -3,7 +3,7 @@ ```powershell Import-Module Microsoft.Graph.Teams $params = @{ - Topic = "Group chat title update" + topic = "Group chat title update" } Update-MgChat -ChatId $chatId -BodyParameter $params diff --git a/src/Teams/Teams/examples/v1.0/Remove-MgTeam.md b/src/Teams/Teams/examples/v1.0/Remove-MgTeam.md index d987c0f6911..eba29921540 100644 --- a/src/Teams/Teams/examples/v1.0/Remove-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0/Remove-MgTeam.md @@ -3,16 +3,16 @@ ```powershell Import-Module Microsoft.Graph.Teams $params = @{ - MemberSettings = @{ - AllowCreateUpdateChannels = $true + memberSettings = @{ + allowCreateUpdateChannels = $true } - MessagingSettings = @{ - AllowUserEditMessages = $true - AllowUserDeleteMessages = $true + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true } - FunSettings = @{ - AllowGiphy = $true - GiphyContentRating = "strict" + funSettings = @{ + allowGiphy = $true + giphyContentRating = "strict" } } diff --git a/src/Teams/Teams/examples/v1.0/Update-MgChat.md b/src/Teams/Teams/examples/v1.0/Update-MgChat.md index 7d3d89e4caf..332cc75c2b0 100644 --- a/src/Teams/Teams/examples/v1.0/Update-MgChat.md +++ b/src/Teams/Teams/examples/v1.0/Update-MgChat.md @@ -1,10 +1,13 @@ -### Example 1: Using the Update-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - Topic = "Group chat title update" + topic = "Group chat title update" } -Update-MgChat -ChatId $chatId -BodyParameter $params -``` -This example shows how to use the Update-MgChat Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgChat -ChatId $chatId -BodyParameter $params +``` +This example shows how to use the Update-MgChat Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + diff --git a/src/Teams/Teams/examples/v1.0/Update-MgTeam.md b/src/Teams/Teams/examples/v1.0/Update-MgTeam.md index 7bde45ee6c4..41638a9e200 100644 --- a/src/Teams/Teams/examples/v1.0/Update-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0/Update-MgTeam.md @@ -1,20 +1,23 @@ -### Example 1: Using the Update-MgTeam Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - MemberSettings = @{ - AllowCreateUpdateChannels = $true + memberSettings = @{ + allowCreateUpdateChannels = $true } - MessagingSettings = @{ - AllowUserEditMessages = $true - AllowUserDeleteMessages = $true + messagingSettings = @{ + allowUserEditMessages = $true + allowUserDeleteMessages = $true } - FunSettings = @{ - AllowGiphy = $true - GiphyContentRating = "strict" + funSettings = @{ + allowGiphy = $true + giphyContentRating = "strict" } } -Update-MgTeam -TeamId $teamId -BodyParameter $params -``` -This example shows how to use the Update-MgTeam Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +Update-MgTeam -TeamId $teamId -BodyParameter $params +``` +This example shows how to use the Update-MgTeam Cmdlet. + To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). +