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..9db63ffa5fd 100644 --- a/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md +++ b/src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md @@ -1,7 +1,9 @@ -### 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: Code snippet + +```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). + 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/Get-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md index 1769d906f4e..1b736580f29 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md @@ -1,14 +1,9 @@ -### 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 + +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). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md index 04a885a039d..46333632f97 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md @@ -1,15 +1,18 @@ -### Example 1: Using the New-MgSubscription Cmdlet -```powershell -Import-Module Microsoft.Graph.ChangeNotifications +### Example 1: Code snippet + +```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" + 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). + +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). + diff --git a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md index b3e85fc18fc..9d7788f802b 100644 --- a/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md +++ b/src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md @@ -1,7 +1,9 @@ -### 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 + +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). + 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/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..260e0b41cd1 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 + +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). + diff --git a/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md b/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md index bf2eb45757a..41a0ce0796b 100644 --- a/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md +++ b/src/Files/Files/examples/v1.0/Get-MgShareSharedDriveItemSharedDriveItem.md @@ -1,7 +1,11 @@ -### Example 1: Using the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet +### 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). + diff --git a/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md index 7f106a34079..d260f2c487a 100644 --- a/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/Get-MgGroupLifecyclePolicy.md @@ -1,14 +1,9 @@ -### 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 + +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). + 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..d946d74f518 100644 --- a/src/Groups/Groups/examples/v1.0/New-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/New-MgGroupLifecyclePolicy.md @@ -1,12 +1,15 @@ -### Example 1: Using the New-MgGroupLifecyclePolicy Cmdlet -```powershell -Import-Module Microsoft.Graph.Groups +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Groups + $params = @{ - GroupLifetimeInDays = 100 - ManagedGroupTypes = "Selected" - AlternateNotificationEmails = "admin@contoso.com" + 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). + +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). + diff --git a/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md b/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md index e35851c5eb5..c97e72096da 100644 --- a/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md +++ b/src/Groups/Groups/examples/v1.0/Remove-MgGroupLifecyclePolicy.md @@ -1,7 +1,9 @@ -### 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 + +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). + 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/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..9a2318b2935 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,18 @@ -### 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: Get a device + +```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: Get a device and return only its id and extensionAttributes properties + +```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). + 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..c591970d6c0 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,9 @@ -### 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 + +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). + 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..00613937f80 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,23 @@ -### Example 1: Using the New-MgDevice Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - AccountEnabled = $false - AlternativeSecurityIds = @( + accountEnabled = $false + alternativeSecurityIds = @( @{ - Type = 2 - Key = [System.Text.Encoding]::ASCII.GetBytes("base64Y3YxN2E1MWFlYw==") + type = 2 + key = [System.Text.Encoding]::ASCII.GetBytes("base64Y3YxN2E1MWFlYw==") } ) - DeviceId = "4c299165-6e8f-4b45-a5ba-c5d250a707ff" - DisplayName = "Test device" - OperatingSystem = "linux" - OperatingSystemVersion = "1" + 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). + +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). + 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..6dba2a400be 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,13 @@ -### Example 1: Using the New-MgDirectoryRole Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement +### Example 1: Code snippet + +```powershell Import-Module Microsoft.Graph.Identity.DirectoryManagement + $params = @{ - RoleTemplateId = "fe930be7-5e62-47db-91af-98c3a49a38b1" + 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). + +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). + 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..f6c6949389e 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,17 @@ -### Example 1: Using the New-MgDomain Cmdlet +### Example 1: {{ Add title here }} ```powershell -Import-Module Microsoft.Graph.Identity.DirectoryManagement -$params = @{ - Id = "contoso.com" -} -New-MgDomain -BodyParameter $params + PS C:\> {{ Add code here }} + +{{ Add output here }} ``` -This example shows how to use the New-MgDomain Cmdlet. -To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference). + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell + PS C:\> {{ Add code here }} + +{{ Add output here }} +``` + +{{ Add description here }} 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..4129ed662d0 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,9 @@ -### 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: Code snippet + +```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). + 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..cf060cd035f 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,9 @@ -### 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 + +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). + 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/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..0d8159bf907 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,9 @@ -### 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 + +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). + 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..458f9c11fa9 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,16 @@ -### Example 1: Using the New-MgOauth2PermissionGrant Cmdlet -```powershell -Import-Module Microsoft.Graph.Identity.SignIns +### Example 1: Code snippet + +```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" + 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). + +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). + 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..0365dbde265 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,9 @@ -### 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 + +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). + 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/Get-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md index 463677ebfe3..b40fa380b9e 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Get-MgSchemaExtension.md @@ -1,14 +1,9 @@ -### 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 + +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). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md index 369d52f1ca4..d3477495995 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/New-MgSchemaExtension.md @@ -1,85 +1,94 @@ -### Example 1: Using the New-MgSchemaExtension Cmdlet -```powershell -Import-Module Microsoft.Graph.SchemaExtensions +### Example 1: Creating a schema extension using a verified domain + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + $params = @{ - Id = "graphlearn_courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( + id = "graphlearn_courses" + description = "Graph Learn training courses extensions" + targetTypes = @( "Group" ) - Properties = @( + 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" } ) } -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 + +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: Creating a schema extension using just a name + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + $params = @{ - Id = "courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( + id = "courses" + description = "Graph Learn training courses extensions" + targetTypes = @( "Group" ) - Properties = @( + 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" } ) } -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 + +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: Creating a schema extension setting the owner + +```powershell Import-Module Microsoft.Graph.SchemaExtensions + $params = @{ - Id = "courses" - Description = "Graph Learn training courses extensions" - TargetTypes = @( + id = "courses" + description = "Graph Learn training courses extensions" + targetTypes = @( "Group" ) - Owner = "50897f70-a455-4adf-87bc-4cf17091d5ac" - Properties = @( + owner = "50897f70-a455-4adf-87bc-4cf17091d5ac" + 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" } ) } -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). + +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). + diff --git a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md index 5fbf9f8da95..b26a308449c 100644 --- a/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md +++ b/src/SchemaExtensions/SchemaExtensions/examples/v1.0/Remove-MgSchemaExtension.md @@ -1,7 +1,9 @@ -### 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 + +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). + 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/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/Get-MgChat.md b/src/Teams/Teams/examples/v1.0/Get-MgChat.md index 7aba3b16c0c..e2148cc5583 100644 --- a/src/Teams/Teams/examples/v1.0/Get-MgChat.md +++ b/src/Teams/Teams/examples/v1.0/Get-MgChat.md @@ -1,28 +1,44 @@ -### Example 1: Using the Get-MgChat Cmdlet +### Example 1: Get a group chat + ```powershell Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId -ExpandProperty "members" + +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 2: Using the Get-MgChat Cmdlet + +### Example 2: Get a chat and all its members + ```powershell Import-Module Microsoft.Graph.Teams -Get-MgChat -ChatId $chatId + +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 3: Using the Get-MgChat Cmdlet + +### Example 3: Get the meeting details of a chat associated with a Microsoft Teams meeting + ```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 + +### Example 4: Get the chat along with the preview of the last message sent in the chat + ```powershell Import-Module Microsoft.Graph.Teams -Get-MgChat -Sort "lastMessagePreview/createdDateTime desc" + +Get-MgChat -ChatId $chatId -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). + diff --git a/src/Teams/Teams/examples/v1.0/Get-MgTeam.md b/src/Teams/Teams/examples/v1.0/Get-MgTeam.md index c5775d5c57f..fe10ef0b010 100644 --- a/src/Teams/Teams/examples/v1.0/Get-MgTeam.md +++ b/src/Teams/Teams/examples/v1.0/Get-MgTeam.md @@ -1,7 +1,9 @@ -### 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 + +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). + diff --git a/src/Teams/Teams/examples/v1.0/New-MgChat.md b/src/Teams/Teams/examples/v1.0/New-MgChat.md index 37c4169c6c9..b984ddb9d2b 100644 --- a/src/Teams/Teams/examples/v1.0/New-MgChat.md +++ b/src/Teams/Teams/examples/v1.0/New-MgChat.md @@ -1,181 +1,162 @@ -### Example 1: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams +### Example 1: Create a one-on-one chat + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( + chatType = "oneOnOne" + members = @( @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" } @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + 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')" + "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 2: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +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: Create a group chat + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - ChatType = "group" - Topic = "Group chat title" - Members = @( + chatType = "group" + topic = "Group chat title" + members = @( @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" } @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" } @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( - "guest" + roles = @( + "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8ba98gf6-7fc2-4eb2-c7f2-aef9f21fd98g')" + "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 3: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +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: Create a one-on-one chat using user principal name + +```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')" - } + chatType = "oneOnOne" + members = @( @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')" } @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('3626a173-f2bc-4883-bcf7-01514c3bfb82')" + "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 4: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +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: Create a group chat with tenant guest user + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - ChatType = "oneOnOne" - Members = @( + chatType = "group" + topic = "Group chat title" + members = @( @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('8c0a1a67-50ce-4114-bb6c-da9c5dbcf6ca')" } @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" - TenantId = "4dc1fe35-8ac6-4f0d-904a-7ebcd364bea1" + "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('82fe7758-5bb3-4f0d-a43f-e555fd399c6f')" } - ) -} -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" + roles = @( + "guest" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')" + "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 6: Using the New-MgChat Cmdlet -```powershell -Import-Module Microsoft.Graph.Teams + +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: Create a one-on-one chat with a federated user (outside of own organization) + +```powershell Import-Module Microsoft.Graph.Teams + $params = @{ - ChatType = "oneOnOne" - Members = @( + chatType = "oneOnOne" + 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('8b081ef6-4792-4def-b2c9-c363a1bf41d5')" } @{ "@odata.type" = "#microsoft.graph.aadUserConversationMember" - Roles = @( + roles = @( "owner" ) - "User@odata.bind" = "https://graph.microsoft.com/v1.0/users('alex@contoso.com')" + "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). + +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). + 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/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). +