Skip to content

Commit

Permalink
Updating examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Microsoft Graph DevX Tooling authored and Microsoft Graph DevX Tooling committed Oct 4, 2024
1 parent b685838 commit 962d256
Show file tree
Hide file tree
Showing 82 changed files with 930 additions and 169 deletions.
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,23 @@
### Example 1: Code snippet

```powershell
Import-Module Microsoft.Graph.Beta.Applications
$params = @{
"@odata.type" = "#microsoft.graph.customClaimsPolicy"
includeBasicClaimSet = "Boolean"
includeApplicationIdInIssuer = "Boolean"
audienceOverride = "String"
claims = @(
@{
"@odata.type" = "microsoft.graph.customClaim"
}
)
}
Set-MgBetaServicePrincipalClaimPolicy -ServicePrincipalId $servicePrincipalId -BodyParameter $params
```
This example shows how to use the Set-MgBetaServicePrincipalClaimPolicy Cmdlet.

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

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

11 changes: 11 additions & 0 deletions src/Bookings/beta/examples/New-MgBetaApproval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell
Import-Module Microsoft.Graph.Beta.Bookings
New-MgBetaApproval
```
This example shows how to use the New-MgBetaApproval Cmdlet.

11 changes: 11 additions & 0 deletions src/Bookings/beta/examples/Stop-MgBetaApprovalItem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell
Import-Module Microsoft.Graph.Beta.Bookings
Stop-MgBetaApprovalItem -ApprovalItemId $approvalItemId
```
This example shows how to use the Stop-MgBetaApprovalItem Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Example 1: Activate an inactive protection policy

```powershell
Import-Module Microsoft.Graph.Bookings
Initialize-MgBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
```
This example will activate an inactive protection policy

### Example 2: Activate an active protection policy

```powershell
Import-Module Microsoft.Graph.Bookings
Initialize-MgBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
```
This example will activate an active protection policy

15 changes: 15 additions & 0 deletions src/Bookings/v1.0/examples/Initialize-MgBackupRestoreServiceApp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Example 1: Code snippet

```powershell
Import-Module Microsoft.Graph.Bookings
$params = @{
effectiveDateTime = [System.DateTime]::Parse("2024-04-19T12:01:03.45Z")
}
Initialize-MgBackupRestoreServiceApp -ServiceAppId $serviceAppId -BodyParameter $params
```
This example shows how to use the Initialize-MgBackupRestoreServiceApp Cmdlet.

11 changes: 11 additions & 0 deletions src/Bookings/v1.0/examples/Initialize-MgBackupRestoreSession.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Example 1: Code snippet

```powershell
Import-Module Microsoft.Graph.Bookings
Initialize-MgBackupRestoreSession -RestoreSessionBaseId $restoreSessionBaseId
```
This example shows how to use the Initialize-MgBackupRestoreSession Cmdlet.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Example 1: Deactivate an active protection policy

```powershell
Import-Module Microsoft.Graph.Bookings
Invoke-MgDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
```
This example will deactivate an active protection policy

### Example 2 : Deactivate a protection policy in updating state

```powershell
Import-Module Microsoft.Graph.Bookings
Invoke-MgDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId
```
This example will### example 2 : deactivate a protection policy in updating state

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

```powershell
Import-Module Microsoft.Graph.Bookings
Invoke-MgDeactivateSolutionBackupRestoreServiceApp -ServiceAppId $serviceAppId
```
This example shows how to use the Invoke-MgDeactivateSolutionBackupRestoreServiceApp Cmdlet.

51 changes: 51 additions & 0 deletions src/Bookings/v1.0/examples/Search-MgBackupRestorePoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
### Example 1: Search request

```powershell
Import-Module Microsoft.Graph.Bookings
$params = @{
protectionUnitIds = @(
"23014d8c-71fe-4d00-a01a-31850bc5b42a"
"43014d8c-71fe-4d00-a01a-31850bc5b42b"
"63014d8c-71fe-4d00-a01a-31850bc5b42c"
"83014d8c-71fe-4d00-a01a-31850bc5b42d"
)
protectionTimePeriod = @{
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
endDateTime = [System.DateTime]::Parse("2021-01-08T00:00:00Z")
}
restorePointPreference = "latest"
tags = "fastRestore"
}
Search-MgBackupRestorePoint -BodyParameter $params
```
This example will search request

### Example 2: Search with artifactQuery expression

```powershell
Import-Module Microsoft.Graph.Bookings
$params = @{
artifactQuery = @{
queryExpression = "(Sender -eq 'abc@contoso.com') -and (Subject -like '*Check email*' -or Subject -like ' Important') -and (HasAttachment -eq 'true') -and (PitrDumpsterActionTriggeredTime -gt '{2024-09-21T08:20:00.0000000Z}')"
artifactType = "message"
}
protectionUnitIds = @(
"23014d8c-71fe-4d00-a01a-31850bc5b42a"
)
protectionTimePeriod = @{
startDateTime = [System.DateTime]::Parse("2021-01-01T00:00:00Z")
}
restorePointPreference = "oldest"
}
Search-MgBackupRestorePoint -BodyParameter $params
```
This example will search with artifactquery expression

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ $params = @{
callOptions = @{
"@odata.type" = "#microsoft.graph.incomingCallOptions"
isContentSharingNotificationEnabled = $true
isDeltaRosterEnabled = $true
}
participantCapacity = 200
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ $params = @{
autopatch = @{
autopatchGroupId = "91197a0b-3a74-408d-ba88-bce3fdc4e5eb"
}
autopilotConfiguration = @{
devicePreparationProfileId = "59e5d3d2-ec68-4bfe-9693-27975b318990"
applicationTimeoutInMinutes = 30
onFailureDeviceAccessDenied = $false
}
}
Update-MgBetaDeviceManagementVirtualEndpointProvisioningPolicy -CloudPcProvisioningPolicyId $cloudPcProvisioningPolicyId -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.roleDefinition"
"@odata.type" = "#microsoft.graph.deviceAndAppManagementRoleDefinition"
displayName = "Display Name value"
description = "Description value"
rolePermissions = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Import-Module Microsoft.Graph.DeviceManagement.Administration
$params = @{
"@odata.type" = "#microsoft.graph.roleDefinition"
"@odata.type" = "#microsoft.graph.deviceAndAppManagementRoleDefinition"
displayName = "Display Name value"
description = "Description value"
rolePermissions = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
$params = @{
description = "An example custom role"
### Example 2
rolePermissions = @(
@{
allowedResourceActions = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment
$params = @{
description = "Update basic properties and permission of application registrations"
### Example 2
rolePermissions = @(
@{
allowedResourceActions = @(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.macOSCompliancePolicy"
"@odata.type" = "#microsoft.graph.windowsPhone81CompliancePolicy"
description = "Description value"
displayName = "Display Name value"
version = 7
passwordRequired = $true
passwordBlockSimple = $true
passwordExpirationDays =
passwordMinimumLength =
passwordMinutesOfInactivityBeforeLock =
passwordPreviousPasswordBlockCount =
passwordMinimumCharacterSetCount =
passwordRequiredType = "alphanumeric"
passwordPreviousPasswordBlockCount =
passwordRequired = $true
osMinimumVersion = "Os Minimum Version value"
osMaximumVersion = "Os Maximum Version value"
systemIntegrityProtectionEnabled = $true
deviceThreatProtectionEnabled = $true
deviceThreatProtectionRequiredSecurityLevel = "secured"
storageRequireEncryption = $true
firewallEnabled = $true
firewallBlockAllIncoming = $true
firewallEnableStealthMode = $true
}
New-MgDeviceManagementDeviceCompliancePolicy -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,11 @@
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.windowsUpdateForBusinessConfiguration"
"@odata.type" = "#microsoft.graph.windows10EnterpriseModernAppManagementConfiguration"
description = "Description value"
displayName = "Display Name value"
version = 7
deliveryOptimizationMode = "httpOnly"
prereleaseFeatures = "settingsOnly"
automaticUpdateMode = "notifyDownload"
microsoftUpdateServiceAllowed = $true
driversExcluded = $true
installationSchedule = @{
"@odata.type" = "microsoft.graph.windowsUpdateScheduledInstall"
scheduledInstallDay = "everyday"
scheduledInstallTime = "11:59:31.3170000"
}
qualityUpdatesDeferralPeriodInDays =
featureUpdatesDeferralPeriodInDays =
qualityUpdatesPaused = $true
featureUpdatesPaused = $true
qualityUpdatesPauseExpiryDateTime = "2017-01-01T00:00:22.9594683-08:00"
featureUpdatesPauseExpiryDateTime = "2016-12-31T23:58:08.068669-08:00"
businessReadyUpdatesOnly = "all"
skipChecksBeforeRestart = $true
updateWeeks = "firstWeek"
qualityUpdatesPauseStartDate = "2016-12-31"
featureUpdatesPauseStartDate = "2016-12-31"
featureUpdatesRollbackWindowInDays =
qualityUpdatesWillBeRolledBack = $true
featureUpdatesWillBeRolledBack = $true
qualityUpdatesRollbackStartDateTime = "2016-12-31T23:57:01.05526-08:00"
featureUpdatesRollbackStartDateTime = "2017-01-01T00:03:21.6080517-08:00"
engagedRestartDeadlineInDays =
engagedRestartSnoozeScheduleInDays =
engagedRestartTransitionScheduleInDays =
deadlineForFeatureUpdatesInDays =
deadlineForQualityUpdatesInDays =
deadlineGracePeriodInDays =
postponeRebootUntilAfterDeadline = $true
autoRestartNotificationDismissal = "automatic"
scheduleRestartWarningInHours =
scheduleImminentRestartWarningInMinutes =
userPauseAccess = "enabled"
userWindowsUpdateScanAccess = "enabled"
updateNotificationLevel = "defaultNotifications"
allowWindows11Upgrade = $true
uninstallBuiltInApps = $true
}
New-MgDeviceManagementDeviceConfiguration -BodyParameter $params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.macOSCompliancePolicy"
"@odata.type" = "#microsoft.graph.windowsPhone81CompliancePolicy"
description = "Description value"
displayName = "Display Name value"
version = 7
passwordRequired = $true
passwordBlockSimple = $true
passwordExpirationDays =
passwordMinimumLength =
passwordMinutesOfInactivityBeforeLock =
passwordPreviousPasswordBlockCount =
passwordMinimumCharacterSetCount =
passwordRequiredType = "alphanumeric"
passwordPreviousPasswordBlockCount =
passwordRequired = $true
osMinimumVersion = "Os Minimum Version value"
osMaximumVersion = "Os Maximum Version value"
systemIntegrityProtectionEnabled = $true
deviceThreatProtectionEnabled = $true
deviceThreatProtectionRequiredSecurityLevel = "secured"
storageRequireEncryption = $true
firewallEnabled = $true
firewallBlockAllIncoming = $true
firewallEnableStealthMode = $true
}
Update-MgDeviceManagementDeviceCompliancePolicy -DeviceCompliancePolicyId $deviceCompliancePolicyId -BodyParameter $params
Expand Down
Loading

0 comments on commit 962d256

Please sign in to comment.