Skip to content

Commit 63beaae

Browse files
Microsoft Graph DevX ToolingMicrosoft Graph DevX Tooling
authored andcommitted
Adds missing descriptions during cmdlet generation
1 parent babba66 commit 63beaae

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/Authentication/Authentication/build-module.ps1

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,49 @@ Write-Host -ForegroundColor Green 'Creating new xml based help file ...'
108108
$DocsPath = (Join-Path $PSScriptRoot "../docs/")
109109
New-ExternalHelp -Path $DocsPath -OutputPath $PSScriptRoot -Force
110110

111+
# Update markdown xml by replacing place holders with actual descriptions for script based cmdlets.
112+
113+
# Place holder values for Find-MgGraphPermission
114+
$SearchStringDescription = "The SearchString parameter allows you to specify a string such as 'user' or 'mail' that represents the subject or domain
115+
of the permission you're searching for. Since permissions usually have names such as 'User.Read' or 'Mail.ReadWrite', the
116+
command uses the SearchString parameter to return all permissions that contain the value specified for SearchString in the
117+
name of the permission."
118+
119+
$ExactMatchDescription = "Specify the ExactMatch parameter to restrict the permissions emitted to those that exactly match the value specified for SearchString."
120+
121+
$PermissionTypeDescription = "Specify the PermissionType to determine whether application permissions, delegated permisisons, or both are returned by
122+
Find-MgGraphPermission. By default, the value of this parameter is Any, which includes both delegated and application permissions.
123+
Other valid values for PermissionType are Application and Delegated to return those specify types of permissions."
124+
125+
$OnlineDescription = "Specify the Online parameter in addition to SearchString to force Find-MgGraphPermission to update its set of permissions
126+
by requesting the latest permissions data from Microsoft Graph itself before searching for the permissions specified the
127+
SearchString parameter. This ensures that Find-MgGraphPermission returns the most accurate search results as new permissions
128+
are added to Microsoft Graph for new APIs. The command uses the existing access to Microsoft Graph as enabled by a previous
129+
invocation of the Connect-MgGraph command to issue the request for updated permissions. If your current connection does not
130+
already have access to read this data from Microsoft Graph or if there is no network connectivity to Microsoft Graph, the command will fail.
131+
If the command is successful in updating the set of permissions prior to searching for permissions, Find-MgGraphPermission will
132+
continue to use the updated list for all future invocations of the command even if they do not specify the Online parameter"
133+
134+
$AllParameterDescription = "To return all possible permissions rather than just those that match the SearchString parameter, specify the All parameter. The
135+
All parameter may also be used with the PermissionType to enumerate all applicaition permissions or all delegated permissions."
136+
137+
# Place holder values for Find-MgGraphCommand
138+
$UriDescription = "The API path a command calls. e.g., /users."
139+
140+
$MethodDescription = "The HTTP method a command makes."
141+
142+
$ApiVersionDescription = "The service API version."
143+
144+
$CommandDescription = "The name of a command. e.g., Get-MgUser."
145+
146+
# Update maml file by replacing place holders with actual value.
147+
(Get-Content "$cmdletsSrc/$ModulePrefix.$ModuleName-Help.xml") -replace "{{ Fill ApiVersion Description }}", $ApiVersionDescription -replace "{{ Fill Command Description }", $CommandDescription -replace "{{ Fill InputObject Description }}", "Pipeline input object" -replace "{{ Fill Uri Description }}", $UriDescription -replace "{{ Fill Method Description }}", $MethodDescription -replace "{{ Fill Command Description }}", $CommandDescription -replace "{{ Fill All Description }}", $AllParameterDescription -replace "{{ Fill Online Description }}", $OnlineDescription -replace "{{ Fill PermissionType Description }}", $PermissionTypeDescription -replace "{{ Fill SearchString Description }}", $SearchStringDescription -replace "{{ Fill ExactMatch Description }}", $ExactMatchDescription -replace "{{ Fill ProgressAction Description }}", "Treat this as a common parameter." | Set-Content "$cmdletsSrc/$ModulePrefix.$ModuleName-Help.xml"
148+
149+
# Update Find-MgGraphPermission markdown file by replacing place holders with actual value.
150+
(Get-Content "$DocsPath/Find-MgGraphPermission.md") -replace "{{ Fill All Description }}", $AllParameterDescription -replace "{{ Fill Online Description }}", $OnlineDescription -replace "{{ Fill PermissionType Description }}", $PermissionTypeDescription -replace "{{ Fill SearchString Description }}", $SearchStringDescription -replace "{{ Fill ExactMatch Description }}", $ExactMatchDescription -replace "{{ Fill ProgressAction Description }}", "Treat this as a common parameter." | Set-Content "$DocsPath/Find-MgGraphPermission.md"
151+
152+
# Update Find-MgGraphCommand markdown file by replacing place holders with actual value.
153+
(Get-Content "$DocsPath/Find-MgGraphCommand.md") -replace "{{ Fill ApiVersion Description }}", $ApiVersionDescription -replace "{{ Fill Command Description }", $CommandDescription -replace "{{ Fill InputObject Description }}", "Pipeline input object" -replace "{{ Fill Uri Description }}", $UriDescription -replace "{{ Fill Method Description }}", $MethodDescription -replace "{{ Fill Command Description }}", $CommandDescription -replace "{{ Fill ProgressAction Description }}", "Treat this as a common parameter."| Set-Content "$DocsPath/Find-MgGraphCommand.md"
111154
# Copy manifest.
112155
Copy-Item -Path "$cmdletsSrc/$ModulePrefix.$ModuleName.format.ps1xml" -Destination $outDir
113156
Copy-Item -Path "$cmdletsSrc/$ModulePrefix.$ModuleName.psm1" -Destination $outDir

0 commit comments

Comments
 (0)