Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ extends:
publishFeedCredentials: 'microsoftgraph PowerShell Gallery connection'

- stage: PushDockerImageToRegistry
condition: and(or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])), not(contains(variables['Build.SourceBranch'], '-preview')))
#condition: and(or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], variables['PREVIEW_BRANCH'])), not(contains(variables['Build.SourceBranch'], '-preview')))
Comment thread
Ndiritu marked this conversation as resolved.
Outdated
dependsOn: stage
displayName: 'Push docker image'
jobs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### Example 1: Code snippet
### Example 2: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment

$params = @{
description = "An example custom role"
### Example 2
displayName = "ExampleCustomRole"
rolePermissions = @(
@{
allowedResourceActions = @(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### Example 1: Code snippet
### Example 2: Code snippet

```powershell

Import-Module Microsoft.Graph.Beta.DeviceManagement.Enrollment

$params = @{
description = "Update basic properties and permission of application registrations"
### Example 2
displayName = "ExampleCustomRole"
rolePermissions = @(
@{
allowedResourceActions = @(
Expand Down
5 changes: 0 additions & 5 deletions src/readme.graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -957,11 +957,6 @@ directive:
subject: ^User$
set:
alias: Set-Mg${subject-prefix}${subject}
- where:
verb: (Get|New|Update|Remove|Set|Invoke|Create)
subject: ^(.*)(OnPremise)(.*)$
set:
alias: ^(.*)(OnPremises)(.*)$

# Setting the alias below as per the request on issue [#3241](https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/3241)

Expand Down
15 changes: 14 additions & 1 deletion tools/ImportExamples.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,14 @@ function Update-ExampleFile {
$SearchTextForNewImports = "{{ Add description here }}"
$ReplaceEverything = $False
if ($HeaderList.Count -eq 0) {
Write-Host "The header list is empty. Please check the external docs url."
for ($d = 0; $d -lt $ExampleList.Count; $d++) {
$sum = $d + 1
$HL = $HeaderList.Add("### Example " + $sum + ": Code snippet".Trim())
}
}
if ($HeaderList.Count -ne $ExampleList.Count) {
Write-Host "The number of examples and the number of headers are not equal. Please check the external docs url."
$HeaderList.Clear()
for ($d = 0; $d -lt $ExampleList.Count; $d++) {
$sum = $d + 1
Expand All @@ -286,6 +288,14 @@ function Update-ExampleFile {
}
$HeadCount = $HeaderList.Count
$ExampleCount = $ExampleList.Count
#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
for ($x = 0; $x -lt $HeaderList.Count; $x++) {
if ($ExampleList[$x] -notmatch "\b$CommandPattern\b") {
$ExampleList.RemoveAt($x)
$HeaderList.RemoveAt($x)
}
}

$WrongExamplesCount = 0;
$SkippedExample = -1
$TotalText = ""
Expand All @@ -298,9 +308,12 @@ function Update-ExampleFile {
Clear-Content $ExampleFile -Force
for ($d = 0; $d -lt $HeaderList.Count; $d++) {
$CodeValue = $ExampleList[$d].Trim()

if ($CodeValue -match "\b$CommandPattern\b") {
Write-Host $CodeValue
$TitleValue = $HeaderList[$d].Trim()
$TitleDesc = $TitleValue

if (-not($TitleValue.Contains("Code snippet"))) {
if ($TitleDesc -match $DescriptionRegex) {
$TitleDesc = $TitleDesc -replace $DescriptionRegex, ''
Expand Down Expand Up @@ -593,4 +606,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/synchronization-synchronization-list-templates?view=graph-rest-beta&tabs=powershell" -GraphCommand "Get-MgBetaServicePrincipalSynchronizationTemplate" -GraphModule "Applications" -Profile "beta"
#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"
Loading