6
6
[string ] $SDKDocsPath = (" ..\msgraph-sdk-powershell\src" ),
7
7
[string ] $SDKOpenApiPath = (" ..\msgraph-sdk-powershell" ),
8
8
[string ] $WorkLoadDocsPath = (" ..\microsoftgraph-docs-powershell\microsoftgraph" ),
9
- [string ] $GraphDocsPath = (" ..\microsoft-graph-docs" )
9
+ [string ] $GraphDocsPath = (" ..\microsoft-graph-docs" ),
10
+ [string ] $MissingMsProdHeaderPath = (" ..\microsoftgraph-docs-powershell\missingexternaldocsurl" )
10
11
)
11
12
function Get-GraphMapping {
12
13
$graphMapping = @ {}
@@ -104,7 +105,7 @@ function Get-Files {
104
105
}
105
106
if ($UriPath ) {
106
107
$Method = $UriPaths.Method
107
- Get-ExternalDocs - Url - GraphProfile $GraphProfile - Url - UriPath $UriPath - Command $Command - OpenApiContent $OpenApiContent - File $File - Method $Method
108
+ Get-ExternalDocs - Url - GraphProfile $GraphProfile - Url - UriPath $UriPath - Command $Command - OpenApiContent $OpenApiContent - File $File - Method $Method - Module $Module
108
109
}
109
110
}
110
111
}
@@ -131,7 +132,8 @@ function Get-ExternalDocs-Url {
131
132
[string ] $Command = " Get-MgUser" ,
132
133
[Hashtable ] $OpenApiContent ,
133
134
[System.Object ] $Method = " GET" ,
134
- [string ] $File = " ..\microsoftgraph-docs-powershell\microsoftgraph\graph-powershell-v1.0\Microsoft.Graph.Users\Get-MgUser.md"
135
+ [string ] $File = " ..\microsoftgraph-docs-powershell\microsoftgraph\graph-powershell-v1.0\Microsoft.Graph.Users\Get-MgUser.md" ,
136
+ [string ] $Module = " Users"
135
137
)
136
138
137
139
if ($UriPath ) {
@@ -175,6 +177,25 @@ function Get-ExternalDocs-Url {
175
177
if (-not ([string ]::IsNullOrEmpty($ExternalDocUrl ))) {
176
178
# $Url = $ExternalDocUrl.split(" ")
177
179
WebScrapping - GraphProfile $GraphProfile - ExternalDocUrl $ExternalDocUrl - Command $Command - File $File
180
+ }else {
181
+ # Add report for missing external docs url
182
+ # Version UriPath Command #Module
183
+ $MissingMetaData = " $MissingMsProdHeaderPath \$Module \$Module .csv"
184
+ # Create folder if it doesn't exist
185
+ if (-not (Test-Path $Folder )) {
186
+ " Graph profile, Command, UriPath" | Out-File - FilePath $MissingMetaData - Encoding ASCII
187
+ }
188
+
189
+ # Check if module already exists
190
+ $File = Get-Content $MissingMetaData
191
+ $containsWord = $file | % { $_ -match " $GraphProfile , $Command , $UriPath " }
192
+ if ($containsWord -contains $true ) {
193
+ # Skip adding to csv
194
+ }
195
+ else {
196
+ " $GraphProfile , $Command , $UriPath " | Out-File - FilePath $MissingMetaData - Append - Encoding ASCII
197
+ }
198
+
178
199
}
179
200
180
201
}
0 commit comments