Skip to content

Commit 412eba8

Browse files
committed
Improved script
1 parent d24ae9c commit 412eba8

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tools/ImportExamples.ps1

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function Start-Generator {
2424
)
2525

2626
$GraphMapping = @{
27-
#"v1.0" = "v1.0\examples"
27+
"v1.0" = "v1.0\examples"
2828
"beta" = "beta\examples"
2929
}
3030
if ($GenerationMode -eq "auto") {
@@ -478,8 +478,15 @@ function Retain-ExistingCorrectExamples {
478478
Set-Content -Path $File -Value $RetainedContent
479479
#Remove the last two empty lines at the end of the file
480480
$Stream = [IO.File]::OpenWrite($ExampleFile)
481-
$Stream.SetLength($stream.Length - 2)
482-
$Stream.Close()
481+
try
482+
{
483+
$Stream.SetLength($stream.Length - 2)
484+
$Stream.Close()
485+
}
486+
catch
487+
{
488+
Write-Error "Error in removing empty lines at the end of the file: $File"
489+
}
483490
$Stream.Dispose()
484491
$RetainedExamples.Clear()
485492
}
@@ -590,4 +597,4 @@ Start-Generator -ModulesToGenerate $ModulesToGenerate -GenerationMode "auto"
590597

591598
#4. Test for beta updates from api reference
592599
#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"
593-
#Start-Generator -GenerationMode "manual" -ManualExternalDocsUrl "https://docs.microsoft.com/graph/api/meetingattendancereport-list?view=graph-rest-1.0" -GraphCommand "New-MgBetaUserEventAttachment" -GraphModule "Calendar" -Profile "beta"
600+
#Start-Generator -GenerationMode "manual" -ManualExternalDocsUrl "https://learn.microsoft.com/en-us/graph/api/identitygovernance-run-get?view=graph-rest-beta&tabs=http" -GraphCommand "Get-MgBetaIdentityGovernanceLifecycleWorkflowDeletedItemWorkflowRun" -GraphModule "Identity.Governance" -Profile "beta"

0 commit comments

Comments
 (0)