Skip to content

Commit 0f1f35e

Browse files
authored
Merge branch 'dev' into WeeklyApiRefresh/202504281452
2 parents 5a6ea3a + 4d9fd9c commit 0f1f35e

18 files changed

+210
-16
lines changed
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +0,0 @@
1-
### Example
2-
3-
```powershell
4-
5-
Import-Module Microsoft.Graph.Beta.Applications
6-
7-
Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId
8-
9-
```
10-
This example shows how to use the Get-MgBetaServicePrincipalSynchronizationTemplate Cmdlet.
11-

src/DeviceManagement.Enrollment/beta/examples/New-MgBetaRoleManagementCloudPcRoleDefinition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
### Example 1: Code snippet
1+
### Example 2: Code snippet
22

33
```powershell
44
55
Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
66
77
$params = @{
88
description = "An example custom role"
9-
### Example 2
9+
displayName = "ExampleCustomRole"
1010
rolePermissions = @(
1111
@{
1212
allowedResourceActions = @(

src/DeviceManagement.Enrollment/beta/examples/Update-MgBetaRoleManagementCloudPcRoleDefinition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
### Example 1: Code snippet
1+
### Example 2: Code snippet
22

33
```powershell
44
55
Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
66
77
$params = @{
88
description = "Update basic properties and permission of application registrations"
9-
### Example 2
9+
displayName = "ExampleCustomRole"
1010
rolePermissions = @(
1111
@{
1212
allowedResourceActions = @(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DeviceManagement
6+
7+
Get-MgBetaDeviceManagementManagedDeviceCloudPcRemoteActionResult -ManagedDeviceId $managedDeviceId
8+
9+
```
10+
This example shows how to use the Get-MgBetaDeviceManagementManagedDeviceCloudPcRemoteActionResult Cmdlet.
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DeviceManagement
6+
7+
Get-MgBetaDeviceManagementManagedDeviceCloudPcReviewStatus -ManagedDeviceId $managedDeviceId
8+
9+
```
10+
This example shows how to use the Get-MgBetaDeviceManagementManagedDeviceCloudPcReviewStatus Cmdlet.
11+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1+
### Example 1: Check group memberships for a directory object
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
6+
7+
$params = @{
8+
groupIds = @(
9+
"f448435d-3ca7-4073-8152-a1fd73c0fd09"
10+
"bd7c6263-4dd5-4ae8-8c96-556e1c0bece6"
11+
"93670da6-d731-4366-94b5-abed40b6016b"
12+
"f5484ab1-4d4d-41ec-a9b8-754b3957bfc7"
13+
"c9103f26-f3cf-4004-a611-2a14e81b8f79"
14+
)
15+
}
16+
17+
Confirm-MgBetaDirectoryObjectMemberGroup -DirectoryObjectId $directoryObjectId -BodyParameter $params
18+
19+
```
20+
This example will check group memberships for a directory object
121

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
6+
7+
Get-MgBetaDirectoryObject -DirectoryObjectId $directoryObjectId
8+
9+
```
10+
This example shows how to use the Get-MgBetaDirectoryObject Cmdlet.
11+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
6+
7+
$params = @{
8+
ids = @(
9+
"84b80893-8749-40a3-97b7-68513b600544"
10+
"5d6059b6-368d-45f8-91e1-8e07d485f1d0"
11+
"0b944de3-e0fc-4774-a49a-b135213725ef"
12+
"b75a5ab2-fe55-4463-bd31-d21ad555c6e0"
13+
)
14+
types = @(
15+
"user"
16+
"group"
17+
"device"
18+
)
19+
}
20+
21+
Get-MgBetaDirectoryObjectById -BodyParameter $params
22+
23+
```
24+
This example shows how to use the Get-MgBetaDirectoryObjectById Cmdlet.
25+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
### Example 1: Retrieve changes for a collection of users and groups
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
6+
7+
Get-MgBetaDirectoryObjectDelta -Filter "isof('microsoft.graph.user') or isof('microsoft.graph.group')"
8+
9+
```
10+
This example will retrieve changes for a collection of users and groups
11+
12+
### Example 2: Retrieve a collection of changes for a directory object
13+
14+
```powershell
15+
16+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
17+
18+
Get-MgBetaDirectoryObjectDelta -Filter "id eq '87d349ed-44d7-43e1-9a83-5f2406dee5bd'"
19+
20+
```
21+
This example will retrieve a collection of changes for a directory object
22+
23+
### Example 3: Retrieve changes to specific properties for a collection of users and groups
24+
25+
```powershell
26+
27+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
28+
29+
Get-MgBetaDirectoryObjectDelta -Filter "isof('microsoft.graph.user') or isof('microsoft.graph.group')" -Property "microsoft.graph.user/surname,microsoft.graph.group/displayName"
30+
31+
```
32+
This example will retrieve changes to specific properties for a collection of users and groups
33+
34+
### Example 4: Retrieve specific properties only if they changed for a collection of users and groups
35+
36+
```powershell
37+
38+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
39+
40+
Get-MgBetaDirectoryObjectDelta -Filter "isof('microsoft.graph.user') or isof('microsoft.graph.group')" -Property "microsoft.graph.user/surname,microsoft.graph.group/displayName"
41+
42+
```
43+
This example will retrieve specific properties only if they changed for a collection of users and groups
44+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
### Example 1: Check group memberships for a directory object
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.DirectoryObjects
6+
7+
$params = @{
8+
securityEnabledOnly = $false
9+
}
10+
11+
Get-MgBetaDirectoryObjectMemberGroup -DirectoryObjectId $directoryObjectId -BodyParameter $params
12+
13+
```
14+
This example will check group memberships for a directory object
115

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1+
### Example 1: Check group memberships for a directory object
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.DirectoryObjects
6+
7+
$params = @{
8+
groupIds = @(
9+
"f448435d-3ca7-4073-8152-a1fd73c0fd09"
10+
"bd7c6263-4dd5-4ae8-8c96-556e1c0bece6"
11+
"93670da6-d731-4366-94b5-abed40b6016b"
12+
"f5484ab1-4d4d-41ec-a9b8-754b3957bfc7"
13+
"c9103f26-f3cf-4004-a611-2a14e81b8f79"
14+
)
15+
}
16+
17+
Confirm-MgDirectoryObjectMemberGroup -DirectoryObjectId $directoryObjectId -BodyParameter $params
18+
19+
```
20+
This example will check group memberships for a directory object
121

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
6+
7+
Get-MgBetaAdminPeopleNamePronunciation
8+
9+
```
10+
This example shows how to use the Get-MgBetaAdminPeopleNamePronunciation Cmdlet.
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Beta.Security
6+
7+
Get-MgBetaSecurityCaseEdiscoveryCaseMember -EdiscoveryCaseId $ediscoveryCaseId
8+
9+
```
10+
This example shows how to use the Get-MgBetaSecurityCaseEdiscoveryCaseMember Cmdlet.
11+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Example 1: Code snippet
2+
3+
```powershell
4+
5+
Import-Module Microsoft.Graph.Teams
6+
7+
Confirm-MgTeamScheduleTimeCard -TeamId $teamId -TimeCardId $timeCardId
8+
9+
```
10+
This example shows how to use the Confirm-MgTeamScheduleTimeCard Cmdlet.
11+

tools/ImportExamples.ps1

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,14 @@ function Update-ExampleFile {
268268
$SearchTextForNewImports = "{{ Add description here }}"
269269
$ReplaceEverything = $False
270270
if ($HeaderList.Count -eq 0) {
271+
Write-Host "The header list is empty. Please check the external docs url."
271272
for ($d = 0; $d -lt $ExampleList.Count; $d++) {
272273
$sum = $d + 1
273274
$HL = $HeaderList.Add("### Example " + $sum + ": Code snippet".Trim())
274275
}
275276
}
276277
if ($HeaderList.Count -ne $ExampleList.Count) {
278+
Write-Host "The number of examples and the number of headers are not equal. Please check the external docs url."
277279
$HeaderList.Clear()
278280
for ($d = 0; $d -lt $ExampleList.Count; $d++) {
279281
$sum = $d + 1
@@ -286,6 +288,14 @@ function Update-ExampleFile {
286288
}
287289
$HeadCount = $HeaderList.Count
288290
$ExampleCount = $ExampleList.Count
291+
#On the example list check the one that contains the command pattern and if doesn't match remove it from the list. Also remove the header from the header list
292+
for ($x = 0; $x -lt $HeaderList.Count; $x++) {
293+
if ($ExampleList[$x] -notmatch "\b$CommandPattern\b") {
294+
$ExampleList.RemoveAt($x)
295+
$HeaderList.RemoveAt($x)
296+
}
297+
}
298+
289299
$WrongExamplesCount = 0;
290300
$SkippedExample = -1
291301
$TotalText = ""
@@ -298,9 +308,12 @@ function Update-ExampleFile {
298308
Clear-Content $ExampleFile -Force
299309
for ($d = 0; $d -lt $HeaderList.Count; $d++) {
300310
$CodeValue = $ExampleList[$d].Trim()
311+
301312
if ($CodeValue -match "\b$CommandPattern\b") {
313+
Write-Host $CodeValue
302314
$TitleValue = $HeaderList[$d].Trim()
303315
$TitleDesc = $TitleValue
316+
304317
if (-not($TitleValue.Contains("Code snippet"))) {
305318
if ($TitleDesc -match $DescriptionRegex) {
306319
$TitleDesc = $TitleDesc -replace $DescriptionRegex, ''
@@ -593,4 +606,4 @@ Start-Generator -ModulesToGenerate $ModulesToGenerate -GenerationMode "auto"
593606

594607
#4. Test for beta updates from api reference
595608
#Start-Generator -GenerationMode "manual" -ManualExternalDocsUrl "https://docs.microsoft.com/graph/api/serviceprincipal-post-approleassignedto?view=graph-rest-beta" -GraphCommand "New-MgBetaServicePrincipalAppRoleAssignedTo" -GraphModule "Applications" -Profile "beta"
596-
#Start-Generator -GenerationMode "manual" -ManualExternalDocsUrl "https://learn.microsoft.com/en-us/graph/api/synchronization-synchronization-list-templates?view=graph-rest-beta&tabs=powershell" -GraphCommand "Get-MgBetaServicePrincipalSynchronizationTemplate" -GraphModule "Applications" -Profile "beta"
609+
#Start-Generator -GenerationMode "manual" -ManualExternalDocsUrl "https://learn.microsoft.com/graph/api/rbacapplication-post-roledefinitions?view=graph-rest-beta" -GraphCommand "New-MgBetaRoleManagementCloudPcRoleDefinition" -GraphModule "DeviceManagement.Enrollment" -Profile "beta"

0 commit comments

Comments
 (0)