Skip to content

Commit af18000

Browse files
authored
Merge pull request #2060 from microsoftgraph/WeeklyExamplesUpdate/202306020302
[v1] Examples Update
2 parents 3281e50 + 2ffd48a commit af18000

File tree

43 files changed

+825
-860
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+825
-860
lines changed

src/Applications/Applications/examples/v1.0/Get-MgApplicationTemplate.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
### Example 1: Using the Get-MgApplicationTemplate Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.Applications
4-
Get-MgApplicationTemplate -ApplicationTemplateId $applicationTemplateId
5-
```
6-
This example shows how to use the Get-MgApplicationTemplate Cmdlet.
7-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
8-
### Example 2: Using the Get-MgApplicationTemplate Cmdlet
9-
```powershell
10-
Import-Module Microsoft.Graph.Applications
11-
Get-MgApplicationTemplate
12-
```
13-
This example shows how to use the Get-MgApplicationTemplate Cmdlet.
14-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.Applications
4+
5+
Get-MgApplicationTemplate -ApplicationTemplateId $applicationTemplateId
6+
```
7+
This example shows how to use the Get-MgApplicationTemplate Cmdlet.
8+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
9+

src/Applications/Applications/examples/v1.0/Remove-MgServicePrincipal.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
### Example 1: Using the Remove-MgServicePrincipal Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.Applications
4-
Remove-MgServicePrincipal -ServicePrincipalId $servicePrincipalId
5-
```
6-
This example shows how to use the Remove-MgServicePrincipal Cmdlet.
7-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.Applications
4+
5+
Remove-MgServicePrincipal -ServicePrincipalId $servicePrincipalId
6+
```
7+
This example shows how to use the Remove-MgServicePrincipal Cmdlet.
8+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
9+

src/Calendar/Calendar/examples/v1.0/Update-MgPlace.md

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
1-
### Example 1: Using the Update-MgPlace Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.Calendar
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.Calendar
4+
45
$params = @{
56
"@odata.type" = "microsoft.graph.room"
6-
Nickname = "Conf Room"
7-
Building = "1"
8-
Label = "100"
9-
Capacity =
10-
IsWheelChairAccessible = $false
7+
nickname = "Conf Room"
8+
building = "1"
9+
label = "100"
10+
capacity =
11+
isWheelChairAccessible = $false
1112
}
12-
Update-MgPlace -PlaceId $placeId -BodyParameter $params
13-
```
14-
This example shows how to use the Update-MgPlace Cmdlet.
15-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
16-
### Example 2: Using the Update-MgPlace Cmdlet
17-
```powershell
18-
Import-Module Microsoft.Graph.Calendar
19-
$params = @{
20-
"@odata.type" = "microsoft.graph.roomList"
21-
DisplayName = "Building 1"
22-
Phone = "555-555-0100"
23-
Address = @{
24-
Street = "4567 Main Street"
25-
City = "Buffalo"
26-
State = "NY"
27-
PostalCode = "98052"
28-
CountryOrRegion = "USA"
29-
}
30-
GeoCoordinates = @{
31-
Altitude = $null
32-
Latitude = 47
33-
Longitude = -122
34-
Accuracy = $null
35-
AltitudeAccuracy = $null
36-
}
37-
}
38-
Update-MgPlace -PlaceId $placeId -BodyParameter $params
39-
```
40-
This example shows how to use the Update-MgPlace Cmdlet.
41-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
13+
14+
Update-MgPlace -PlaceId $placeId -BodyParameter $params
15+
```
16+
This example shows how to use the Update-MgPlace Cmdlet.
17+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
18+

src/ChangeNotifications/ChangeNotifications/examples/v1.0/Get-MgSubscription.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
### Example 1: Using the Get-MgSubscription Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.ChangeNotifications
4-
Get-MgSubscription -SubscriptionId $subscriptionId
5-
```
6-
This example shows how to use the Get-MgSubscription Cmdlet.
7-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
8-
### Example 2: Using the Get-MgSubscription Cmdlet
9-
```powershell
10-
Import-Module Microsoft.Graph.ChangeNotifications
11-
Get-MgSubscription
12-
```
13-
This example shows how to use the Get-MgSubscription Cmdlet.
14-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.ChangeNotifications
4+
5+
Get-MgSubscription -SubscriptionId $subscriptionId
6+
```
7+
This example shows how to use the Get-MgSubscription Cmdlet.
8+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
9+

src/ChangeNotifications/ChangeNotifications/examples/v1.0/New-MgSubscription.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
### Example 1: Using the New-MgSubscription Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.ChangeNotifications
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.ChangeNotifications
4+
45
$params = @{
5-
ChangeType = "created"
6-
NotificationUrl = "https://webhook.azurewebsites.net/api/send/myNotifyClient"
7-
Resource = "me/mailFolders('Inbox')/messages"
8-
ExpirationDateTime = [System.DateTime]::Parse("2016-11-20T18:23:45.9356913Z")
9-
ClientState = "secretClientValue"
10-
LatestSupportedTlsVersion = "v1_2"
6+
changeType = "created"
7+
notificationUrl = "https://webhook.azurewebsites.net/api/send/myNotifyClient"
8+
resource = "me/mailFolders('Inbox')/messages"
9+
expirationDateTime = [System.DateTime]::Parse("2016-11-20T18:23:45.9356913Z")
10+
clientState = "secretClientValue"
11+
latestSupportedTlsVersion = "v1_2"
1112
}
12-
New-MgSubscription -BodyParameter $params
13-
```
14-
This example shows how to use the New-MgSubscription Cmdlet.
15-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
13+
14+
New-MgSubscription -BodyParameter $params
15+
```
16+
This example shows how to use the New-MgSubscription Cmdlet.
17+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
18+

src/ChangeNotifications/ChangeNotifications/examples/v1.0/Remove-MgSubscription.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
### Example 1: Using the Remove-MgSubscription Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.ChangeNotifications
4-
Remove-MgSubscription -SubscriptionId $subscriptionId
5-
```
6-
This example shows how to use the Remove-MgSubscription Cmdlet.
7-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.ChangeNotifications
4+
5+
Remove-MgSubscription -SubscriptionId $subscriptionId
6+
```
7+
This example shows how to use the Remove-MgSubscription Cmdlet.
8+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
9+

src/ChangeNotifications/ChangeNotifications/examples/v1.0/Update-MgSubscription.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
### Example 1: Using the Update-MgSubscription Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.ChangeNotifications
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.ChangeNotifications
4+
45
$params = @{
5-
ExpirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z")
6+
expirationDateTime = [System.DateTime]::Parse("2016-11-22T18:23:45.9356913Z")
67
}
7-
Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params
8-
```
9-
This example shows how to use the Update-MgSubscription Cmdlet.
10-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
8+
9+
Update-MgSubscription -SubscriptionId $subscriptionId -BodyParameter $params
10+
```
11+
This example shows how to use the Update-MgSubscription Cmdlet.
12+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
13+

src/DirectoryObjects/DirectoryObjects/examples/v1.0/Get-MgDirectoryObject.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
### Example 1: Using the Get-MgDirectoryObject Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.DirectoryObjects
4-
Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId
5-
```
6-
This example shows how to use the Get-MgDirectoryObject Cmdlet.
7-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.DirectoryObjects
4+
5+
Get-MgDirectoryObject -DirectoryObjectId $directoryObjectId
6+
```
7+
This example shows how to use the Get-MgDirectoryObject Cmdlet.
8+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
9+

src/DirectoryObjects/DirectoryObjects/examples/v1.0/Remove-MgDirectoryObject.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
### Example 1: Using the Remove-MgDirectoryObject Cmdlet
2-
```powershell
3-
Import-Module Microsoft.Graph.DirectoryObjects
4-
Remove-MgDirectoryObject -DirectoryObjectId $directoryObjectId
5-
```
6-
This example shows how to use the Remove-MgDirectoryObject Cmdlet.
7-
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
1+
### Example 1: Code snippet
2+
3+
```powershellImport-Module Microsoft.Graph.DirectoryObjects
4+
5+
Remove-MgDirectoryObject -DirectoryObjectId $directoryObjectId
6+
```
7+
This example shows how to use the Remove-MgDirectoryObject Cmdlet.
8+
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
9+
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
### Example 1: Using the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet
1+
### Example 1: Code snippet
2+
23
```powershell
34
Import-Module Microsoft.Graph.Files
5+
46
Get-MgShareSharedDriveItemSharedDriveItem -SharedDriveItemId $sharedDriveItemId
57
```
68
This example shows how to use the Get-MgShareSharedDriveItemSharedDriveItem Cmdlet.
9+
710
To learn about permissions for this resource, see the [permissions reference](/graph/permissions-reference).
11+

0 commit comments

Comments
 (0)