Skip to content

Removes unnecessary '#' characters in example descriptions #3080

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 2 commits into from
Jan 21, 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
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Beta.Applications
Get-MgBetaApplicationDelta

```
This example will### example
This example shows how to use the Get-MgBetaApplicationDelta Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Beta.Applications
Get-MgBetaServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

```
This example will### example
This example shows how to use the Get-MgBetaServicePrincipalSynchronizationTemplate Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Applications
Get-MgServicePrincipalSynchronizationTemplate -ServicePrincipalId $servicePrincipalId

```
This example will### example
This example shows how to use the Get-MgServicePrincipalSynchronizationTemplate Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Import-Module Microsoft.Graph.Beta.Bookings
Initialize-MgBetaBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 1 : activate an inactive protection policy
This example will activate an inactive protection policy

### Example 2 : Activate an active protection policy

Expand All @@ -18,5 +18,5 @@ Import-Module Microsoft.Graph.Beta.Bookings
Initialize-MgBetaBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 2 : activate an active protection policy
This example will activate an active protection policy

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Import-Module Microsoft.Graph.Beta.Bookings
Invoke-MgBetaDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 2 : deactivate a protection policy in updating state
This example will deactivate a protection policy in updating state

Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ Import-Module Microsoft.Graph.Bookings
Invoke-MgDeactivateSolutionBackupRestoreProtectionPolicy -ProtectionPolicyBaseId $protectionPolicyBaseId

```
This example will### example 2 : deactivate a protection policy in updating state
This example will deactivate a protection policy in updating state

Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ $params = @{
New-MgBetaCommunicationCall -BodyParameter $params

```
This example will### example 10: join channel meeting as a guest with service hosted media
This example will join channel meeting as a guest with service hosted media

### Example 11: Create peer-to-peer PSTN call with service hosted media

Expand Down Expand Up @@ -498,7 +498,7 @@ $params = @{
New-MgBetaCommunicationCall -BodyParameter $params

```
This example will### example 11: create peer-to-peer pstn call with service hosted media
This example will create peer-to-peer pstn call with service hosted media

### Example 12: Create peer-to-peer PSTN call with application hosted media

Expand Down Expand Up @@ -549,5 +549,5 @@ $params = @{
New-MgBetaCommunicationCall -BodyParameter $params

```
This example will### example 12: create peer-to-peer pstn call with application hosted media
This example will create peer-to-peer pstn call with application hosted media

Original file line number Diff line number Diff line change
Expand Up @@ -450,5 +450,5 @@ $params = @{
New-MgCommunicationCall -BodyParameter $params

```
This example will### example 10: create peer-to-peer pstn call with application hosted media
This example will create peer-to-peer pstn call with application hosted media

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Beta.Identity.DirectoryManagement
Get-MgBetaDirectoryRoleDelta

```
This example will### example
This example shows how to use the Get-MgBetaDirectoryRoleDelta Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Identity.DirectoryManagement
Get-MgDirectoryRoleDelta

```
This example will### example
This example shows how to use the Get-MgDirectoryRoleDelta Cmdlet.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Beta.Identity.Governance
Get-MgBetaEntitlementManagementAccessPackageAssignment

```
This example will### example scenarios for using query parameters
This example shows scenarios for using query parameters

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Beta.Identity.Governance
Get-MgBetaEntitlementManagementAssignmentRequest

```
This example will### example scenarios for using query parameters
This example shows scenarios for using query parameters

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Import-Module Microsoft.Graph.Beta.Identity.Governance
Get-MgBetaRoleManagementDirectoryRoleAssignment -UnifiedRoleAssignmentId $unifiedRoleAssignmentId

```
This example will### Example 1: get details of a role assignment
This example will get details of a role assignment

### Example 2: Get details of a role assignment and expand the role definition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Get-MgBetaRoleManagementDirectoryTransitiveRoleAssignment -CountVariable CountVa


```
This example will### example 1 : get direct and transitive role assignments of a principal
This example will get direct and transitive role assignments of a principal

### Example 2: Get direct and transitive assignments of a principal, but only specific role definitions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $params = @{
New-MgBetaRoleManagementDirectoryRoleAssignment -BodyParameter $params

```
This example will### Example 2: create a role assignment with administrative unit scope
This example will create a role assignment with administrative unit scope

### Example 3: Create a role assignment with attribute set scope

Expand All @@ -50,5 +50,5 @@ $params = @{
New-MgBetaRoleManagementDirectoryRoleAssignment -BodyParameter $params

```
This example will### Example 3: create a role assignment with attribute set scope
This example will create a role assignment with attribute set scope

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Identity.Governance
Get-MgEntitlementManagementAssignment

```
This example will### example scenarios for using query parameters
This example shows scenarios for using query parameters

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Identity.Governance
Get-MgEntitlementManagementAssignmentRequest

```
This example will### example scenarios for using query parameters
This example shows scenarios for using query parameters

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Import-Module Microsoft.Graph.Identity.Governance
Get-MgRoleManagementDirectoryRoleAssignment -UnifiedRoleAssignmentId $unifiedRoleAssignmentId

```
This example will### example 1 : get the details of a role assignment
This example will get the details of a role assignment

### Example 2: Get the details of a role assignment and expand the relationships

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $params = @{
New-MgRoleManagementDirectoryRoleAssignment -BodyParameter $params

```
This example will### Example 2: create a role assignment with administrative unit scope
This example will create a role assignment with administrative unit scope

### Example 3: Create a role assignment with application scope

Expand All @@ -50,5 +50,5 @@ $params = @{
New-MgRoleManagementDirectoryRoleAssignment -BodyParameter $params

```
This example will### Example 3: create a role assignment with application scope
This example will create a role assignment with application scope

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaServicePrincipalRiskDetection -ServicePrincipalRiskDetectionId $servicePrincipalRiskDetectionId

```
This example will### example: get a specific risk detection object
This example will get a specific risk detection object

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Import-Module Microsoft.Graph.Identity.SignIns
Get-MgServicePrincipalRiskDetection -ServicePrincipalRiskDetectionId $servicePrincipalRiskDetectionId

```
This example will### example: get a specific risk detection object
This example will get a specific risk detection object

Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ $params = @{
Set-MgBetaExternalConnectionItem -ExternalConnectionId $externalConnectionId -ExternalItemId $externalItemId -BodyParameter $params

```
This example will### example: create a custom item
This example will create a custom item

2 changes: 1 addition & 1 deletion src/Search/v1.0/examples/Set-MgExternalConnectionItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ $params = @{
Set-MgExternalConnectionItem -ExternalConnectionId $externalConnectionId -ExternalItemId $externalItemId -BodyParameter $params

```
This example will### example: create a custom item
This example will create a custom item

2 changes: 1 addition & 1 deletion src/Teams/beta/examples/New-MgBetaChatMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ $params = @{
New-MgBetaChatMessage -ChatId $chatId -BodyParameter $params

```
This example will### Example 2: send a message with an emoji
This example will send a message with an emoji

8 changes: 4 additions & 4 deletions src/Teams/beta/examples/New-MgBetaTeamChannelMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ $params = @{
New-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -BodyParameter $params

```
This example will### Example 6: @mention a channel in a channel message
This example will @mention a channel in a channel message

### Example 7: @mention a team in a channel message

Expand Down Expand Up @@ -328,7 +328,7 @@ $params = @{
New-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -BodyParameter $params

```
This example will### Example 8: @mention a tag in a channel message
This example will @mention a tag in a channel message

### Example 9: Send message that contains cards that are attributed to a Teams app

Expand Down Expand Up @@ -371,7 +371,7 @@ $params = @{
New-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -BodyParameter $params

```
This example will### Example 9: send message that contains cards that are attributed to a teams app
This example will send message that contains cards that are attributed to a teams app

### Example 10: Send a message that contains an announcement

Expand Down Expand Up @@ -412,5 +412,5 @@ $params = @{
New-MgBetaTeamChannelMessage -TeamId $teamId -ChannelId $channelId -BodyParameter $params

```
This example will### Example 10: send a message that contains an announcement
This example will send a message that contains an announcement

2 changes: 1 addition & 1 deletion src/Teams/v1.0/examples/Get-MgChatInstalledApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Import-Module Microsoft.Graph.Teams
Get-MgChatInstalledApp -ChatId $chatId -TeamsAppInstallationId $teamsAppInstallationId

```
This example will### example 1 : get the app installed in the specified chat
This example will get the app installed in the specified chat

### Example 2: Get the set of resource-specific permissions consented for the app installed in the specified chat

Expand Down
2 changes: 1 addition & 1 deletion src/Teams/v1.0/examples/New-MgChatMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ $params = @{
New-MgChatMessage -ChatId $chatId -BodyParameter $params

```
This example will### Example 2: send a message with an emoji
This example will send a message with an emoji

4 changes: 2 additions & 2 deletions src/Teams/v1.0/examples/New-MgTeamChannelMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ $params = @{
New-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -BodyParameter $params

```
This example will### Example 9: send message that contains cards that are attributed to a teams app
This example will send message that contains cards that are attributed to a teams app

### Example 10: Send a message that contains an announcement

Expand Down Expand Up @@ -407,5 +407,5 @@ $params = @{
New-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -BodyParameter $params

```
This example will### Example 10: send a message that contains an announcement
This example will send a message that contains an announcement

29 changes: 24 additions & 5 deletions tools/ImportExamples.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,17 @@ function Update-ExampleFile {
elseif ($FirstDescriptionString.EndsWith("ing")) {
$DescriptionPrefix = "This example shows"
}

$Description = $DescriptionPrefix + $TitleDesc.ToLower()
elseif ($FirstDescriptionString.EndsWith("Example")) {
$DescriptionPrefix = "This example shows how to use"
}

$Description = ""
if ($FirstDescriptionString -eq "Example") {
$Description = "This example shows how to use the $CommandPattern Cmdlet."
}
else {
$Description = $DescriptionPrefix + $TitleDesc.ToLower()
}
}
$TotalText = "$TitleValue`r`n`n$CodeValue`r`n$Description`r`n"
Add-Content -Path $ExampleFile -Value $TotalText
Expand All @@ -340,6 +349,7 @@ function Update-ExampleFile {
$ContainsPatternToSearch = $True
}
}
Write-Host $ContainsPatternToSearch
if ($ContainsPatternToSearch) {
Clear-Content $ExampleFile -Force
for ($d = 0; $d -lt $HeaderList.Count; $d++) {
Expand All @@ -360,8 +370,17 @@ function Update-ExampleFile {
elseif ($FirstDescriptionString.EndsWith("ing")) {
$DescriptionPrefix = "This example shows"
}

$Description = $DescriptionPrefix + $TitleDesc.ToLower()
elseif ($FirstDescriptionString.EndsWith("Example")) {
$DescriptionPrefix = "This example shows how to use"
}

$Description = ""
if ($FirstDescriptionString -eq "Example") {
$Description = "This example shows how to use the $CommandPattern Cmdlet."
}
else {
$Description = $DescriptionPrefix + $TitleDesc.ToLower()
}
}
$TotalText = "$TitleValue`r`n`n$CodeValue`r`n$Description`r`n"
Add-Content -Path $ExampleFile -Value $TotalText
Expand Down Expand Up @@ -573,4 +592,4 @@ Start-Generator -ModulesToGenerate $ModulesToGenerate -GenerationMode "auto"

#4. Test for beta updates from api reference
#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"
#Start-Generator -GenerationMode "manual" -ManualExternalDocsUrl "https://learn.microsoft.com/en-us/graph/api/subscription-reauthorize?view=graph-rest-1.0&tabs=powershell" -GraphCommand "Invoke-MgReauthorizeSubscription" -GraphModule "ChangeNotifications" -Profile "v1.0"
#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"
Loading