Skip to content

[v2] Examples Update #3068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example

```powershell

Import-Module Microsoft.Graph.Beta.Applications

Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

```
This example will### example

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example

```powershell

Import-Module Microsoft.Graph.Applications

Get-MgServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

```
This example will### example

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ $params = @{
displayName = "Example"
selfServiceEnabled = $false
localAdminEnabled = $true
crossRegionDisasterRecoverySetting = @{
crossRegionDisasterRecoveryEnabled = $false
maintainCrossRegionRestorePointEnabled = $true
disasterRecoveryNetworkSetting = @{
regionName = "westus"
regionGroup = "usEast"
}
disasterRecoveryType = "premium"
userInitiatedDisasterRecoveryAllowed = $true
}
restorePointSetting = @{
frequencyInHours = 16
frequencyType = "sixteenHours"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ $params = @{
frequencyType = "sixteenHours"
userRestoreEnabled = $true
}
crossRegionDisasterRecoverySetting = @{
crossRegionDisasterRecoveryEnabled = $false
maintainCrossRegionRestorePointEnabled = $true
disasterRecoveryNetworkSetting = @{
regionName = "westus"
regionGroup = "usEast"
}
disasterRecoveryType = "premium"
userInitiatedDisasterRecoveryAllowed = $true
}
localAdminEnabled = $false
resetEnabled = $true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,18 @@ Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $directoryObjectId -BodyPa
```
This example shows how to use the Restore-MgBetaDirectoryDeletedItem Cmdlet.

### Example 3: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement

$params = @{
newUserPrincipalName = "johndoe@contoso.com"
}

Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId $directoryObjectId -BodyParameter $params

```
This example shows how to use the Restore-MgBetaDirectoryDeletedItem Cmdlet.

15 changes: 13 additions & 2 deletions src/Reports/beta/examples/Get-MgBetaAuditLogDirectoryAudit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Example 1: Code snippet
### Example 1: Retrieve the list of audit logs

```powershell

Expand All @@ -7,5 +7,16 @@ Import-Module Microsoft.Graph.Beta.Reports
Get-MgBetaAuditLogDirectoryAudit

```
This example shows how to use the Get-MgBetaAuditLogDirectoryAudit Cmdlet.
This example will retrieve the list of audit logs

### Example 2: Retrieve the list of audit logs with a filter on initiatedBy/user

```powershell

Import-Module Microsoft.Graph.Beta.Reports

Get-MgBetaAuditLogDirectoryAudit -Filter "initiatedBy/user/id eq '00000000-0000-0000-0000-000000000000'"

```
This example will retrieve the list of audit logs with a filter on initiatedby/user

15 changes: 13 additions & 2 deletions src/Reports/v1.0/examples/Get-MgAuditLogDirectoryAudit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Example 1: Code snippet
### Example 1: Retrieve the list of audit logs

```powershell

Expand All @@ -7,5 +7,16 @@ Import-Module Microsoft.Graph.Reports
Get-MgAuditLogDirectoryAudit

```
This example shows how to use the Get-MgAuditLogDirectoryAudit Cmdlet.
This example will retrieve the list of audit logs

### Example 2: Retrieve the list of audit logs with a filter on initiatedBy/user

```powershell

Import-Module Microsoft.Graph.Reports

Get-MgAuditLogDirectoryAudit -Filter "initiatedBy/user/id eq '00000000-0000-0000-0000-000000000000'"

```
This example will retrieve the list of audit logs with a filter on initiatedby/user

3 changes: 3 additions & 0 deletions src/Teams/beta/examples/New-MgBetaTeam.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $params = @{
"template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')"
displayName = "My Sample Team"
description = "My Sample Team's Description"
firstChannelName = "My First Channel of the sample team"
}

New-MgBetaTeam -BodyParameter $params
Expand All @@ -25,6 +26,7 @@ $params = @{
"template@odata.bind" = "https://graph.microsoft.com/beta/teamsTemplates('standard')"
displayName = "My Sample Team"
description = "My Sample Team’s Description"
firstChannelName = "My First Channel of the sample team"
members = @(
@{
"@odata.type" = "#microsoft.graph.aadUserConversationMember"
Expand Down Expand Up @@ -52,6 +54,7 @@ $params = @{
visibility = "Private"
displayName = "Sample Engineering Team"
description = "This is a sample engineering team, used to showcase the range of properties supported by this API"
firstChannelName = "My First Channel of the team"
channels = @(
@{
displayName = "Announcements 📢"
Expand Down
34 changes: 8 additions & 26 deletions src/Teams/v1.0/examples/New-MgTeamScheduleOpenShift.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,19 @@
Import-Module Microsoft.Graph.Teams

$params = @{
id = "OPNSHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8"
schedulingGroupId = "TAG_228940ed-ff84-4e25-b129-1b395cf78be0"
schedulingGroupId = "TAG_4ab7d329-1f7e-4eaf-ba93-63f1ff3f3c4a"
sharedOpenShift = @{
notes = "InventoryManagement"
openSlotCount = 2
displayName = "Dayshift"
startDateTime = [System.DateTime]::Parse("2018-10-04T00: 58: 45.340Z")
endDateTime = [System.DateTime]::Parse("2018-10-04T09: 50: 45.332Z")
theme = "white"
startDateTime = [System.DateTime]::Parse("2024-11-04T20:00:00Z")
endDateTime = [System.DateTime]::Parse("2024-11-04T21:00:00Z")
theme = "blue"
notes = "InventoryManagement"
openSlotCount = 1
activities = @(
@{
isPaid = $true
startDateTime = [System.DateTime]::Parse("2018-10-04T00: 58: 45.340Z")
endDateTime = [System.DateTime]::Parse("2018-10-04T01: 58: 45.340Z")
code = ""
displayName = "Lunch"
}
)
}
draftOpenShift = $null
createdDateTime = [System.DateTime]::Parse("2019-03-14T04: 32: 51.451Z")
lastModifiedDateTime = [System.DateTime]::Parse("2019-03-14T05: 32: 51.451Z")
lastModifiedBy = @{
application = $null
device = $null
conversation = $null
user = @{
id = "366c0b19-49b1-41b5-a03f-9f3887bd0ed8"
displayName = "JohnDoe"
}
}
draftTimeOff = $null
isStagedForDeletion = $false
}

New-MgTeamScheduleOpenShift -TeamId $teamId -BodyParameter $params
Expand Down
37 changes: 7 additions & 30 deletions src/Teams/v1.0/examples/New-MgTeamScheduleShift.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,18 @@
Import-Module Microsoft.Graph.Teams

$params = @{
id = "SHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8"
userId = "c5d0c76b-80c4-481c-be50-923cd8d680a1"
schedulingGroupId = "TAG_228940ed-ff84-4e25-b129-1b395cf78be0"
sharedShift = @{
displayName = "Day shift"
notes = "Please do inventory as part of your shift."
startDateTime = [System.DateTime]::Parse("2019-03-11T15:00:00Z")
endDateTime = [System.DateTime]::Parse("2019-03-12T00:00:00Z")
theme = "blue"
activities = @(
@{
isPaid = $true
startDateTime = [System.DateTime]::Parse("2019-03-11T15:00:00Z")
endDateTime = [System.DateTime]::Parse("2019-03-11T15:15:00Z")
code = ""
displayName = "Lunch"
}
)
}
userId = "5ca83ce7-291d-43b7-bf53-af79eef4bc1d"
draftShift = @{
displayName = "Day shift"
notes = "Please do inventory as part of your shift."
startDateTime = [System.DateTime]::Parse("2019-03-11T15:00:00Z")
endDateTime = [System.DateTime]::Parse("2019-03-12T00:00:00Z")
displayName = $null
startDateTime = [System.DateTime]::Parse("2024-10-08T15:00:00Z")
endDateTime = [System.DateTime]::Parse("2024-10-09T00:00:00Z")
theme = "blue"
notes = $null
activities = @(
@{
isPaid = $true
startDateTime = [System.DateTime]::Parse("2019-03-11T15:00:00Z")
endDateTime = [System.DateTime]::Parse("2019-03-11T15:30:00Z")
code = ""
displayName = "Lunch"
}
)
}
sharedShift = $null
isStagedForDeletion = $false
}

New-MgTeamScheduleShift -TeamId $teamId -BodyParameter $params
Expand Down
18 changes: 7 additions & 11 deletions src/Teams/v1.0/examples/New-MgTeamScheduleTimeOff.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@
Import-Module Microsoft.Graph.Teams

$params = @{
userId = "c5d0c76b-80c4-481c-be50-923cd8d680a1"
userId = "aa162a04-bec6-4b81-ba99-96caa7b2b24d"
sharedTimeOff = @{
timeOffReasonId = "TOR_891045ca-b5d2-406b-aa06-a3c8921245d7"
startDateTime = [System.DateTime]::Parse("2019-03-11T07:00:00Z")
endDateTime = [System.DateTime]::Parse("2019-03-12T07:00:00Z")
theme = "white"
}
draftTimeOff = @{
timeOffReasonId = "TOR_891045ca-b5d2-406b-aa06-a3c8921245d7"
startDateTime = [System.DateTime]::Parse("2019-03-11T07:00:00Z")
endDateTime = [System.DateTime]::Parse("2019-03-12T07:00:00Z")
theme = "pink"
timeOffReasonId = "TOR_29a5ba96-c7ef-4e76-bec6-055323746314"
startDateTime = [System.DateTime]::Parse("2024-10-10T19:00:00Z")
endDateTime = [System.DateTime]::Parse("2024-10-10T20:00:00Z")
theme = "blue"
}
draftTimeOff = $null
isStagedForDeletion = $false
}

New-MgTeamScheduleTimeOff -TeamId $teamId -BodyParameter $params
Expand Down
15 changes: 8 additions & 7 deletions src/Teams/v1.0/examples/New-MgTeamworkWorkforceIntegration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
Import-Module Microsoft.Graph.Teams

$params = @{
displayName = "displayName-value"
apiVersion = 99
displayName = "ABCWorkforceIntegration"
apiVersion = 1
isActive = $true
encryption = @{
protocol = "protocol-value"
secret = "secret-value"
protocol = "sharedSecret"
secret = "My Secret"
}
isActive = $true
url = "url-value"
supportedEntities = "supportedEntities-value"
url = "https://ABCWorkforceIntegration.com/Contoso/"
supportedEntities = "Shift,SwapRequest"
eligibilityFilteringEnabledEntities = "SwapRequest"
}

New-MgTeamworkWorkforceIntegration -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
Import-Module Microsoft.Graph.Teams

$params = @{
displayName = "displayName-value"
apiVersion = 99
displayName = "ABCWorkforceIntegration"
apiVersion = 1
isActive = $true
encryption = @{
protocol = "protocol-value"
secret = "secret-value"
protocol = "sharedSecret"
secret = "My Secret"
}
isActive = $true
url = "url-value"
supportedEntities = "supportedEntities-value"
url = "https://ABCWorkforceIntegration.com/Contoso/"
supportedEntities = "Shift,SwapRequest"
eligibilityFilteringEnabledEntities = "SwapRequest"
}

Update-MgTeamworkWorkforceIntegration -WorkforceIntegrationId $workforceIntegrationId -BodyParameter $params
Expand Down
Loading