File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
.azure-pipelines/generation-templates Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,14 @@ steps:
3030 script : |
3131 . $(System.DefaultWorkingDirectory)/tools/GenerateModules.ps1 -SkipGeneration -Test
3232
33+ - task : PowerShell@2
34+ displayName : Find Duplicate Commands
35+ inputs :
36+ targetType : inline
37+ pwsh : true
38+ script : |
39+ . $(System.DefaultWorkingDirectory)/tools/PostGeneration/FindDuplicateCommand.ps1 -SourcePath "$(System.DefaultWorkingDirectory)/src/"
40+
3341 - ${{ if eq(parameters.Sign, true) }} :
3442 - template : ../common-templates/esrp/strongname.yml
3543 parameters :
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ directive:
3232 subject : $1AllowedCalendarSharingRoles
3333 - where :
3434 verb : Get
35- subject : ^(UserChatMessage )$
35+ subject : ^(User)(ChatMessage|OnlineMeetingTranscript|OnlineMeetingRecording )$
3636 set :
37- subject : All$1
37+ subject : All$1$2
3838` ` `
Original file line number Diff line number Diff line change @@ -15,17 +15,17 @@ if (!(Test-Path $SourcePath)) {
1515 Write-Error " SourcePath is not valid or does not exist. Please ensure that $SourcePath exists then try again."
1616}
1717
18- $psd1s = Get-ChildItem - Path $SourcePath - Filter " Microsoft.Graph.*.psd1" - Recurse | where { $_.BaseName -ne " Microsoft.Graph.Authentication" }
19- $allModules = ( Invoke-Expression (( $psd1s.FullName | ForEach-Object { Get-Content $_ }) | Out-String ))
18+ $psd1s = Get-ChildItem - Path $SourcePath - Filter " Microsoft.Graph.*.psd1" - Recurse | Where-Object { $_.BaseName -ne " Microsoft.Graph.Authentication" }
19+ $allModules = Import-PowerShellDataFile $psd1s.FullName
2020$unique = $allModules.FunctionsToExport | Select-Object - unique
2121$duplicates = Compare-object - ReferenceObject $unique - DifferenceObject $allModules.FunctionsToExport
2222
2323if ($duplicates.Count -gt 0 ) {
2424 Write-Host " The following functions are duplicated in the psd1 files:"
25- $duplicates.InputObject | % {
25+ $duplicates.InputObject | ForEach-Object {
2626 $duplicateCommand = $_
2727 Write-Host " $duplicateCommand is duplicated in:"
28- Write-Host ($allModules | where { $_.FunctionsToExport -contains $duplicateCommand }).RootModule
28+ Write-Host ($allModules | Where-Object { $_.FunctionsToExport -contains $duplicateCommand }).RootModule
2929 Write-Host " ********************************"
3030 }
3131 Write-Error " Please ensure that the functions are unique and try again."
You can’t perform that action at this time.
0 commit comments