Skip to content

Commit 1545e22

Browse files
committed
Added confirmation of file availability
1 parent 847f7b6 commit 1545e22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/UpdateLinks.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ function Add-Link {
160160

161161
$Link = "> [!NOTE]`n> $LinkTitle [$CommandRename]($BaseUrl/$FullModuleName$View)`r`n`n## SYNTAX"
162162
$LinkOnEndOfDoc = "## RELATED LINKS`r`n[$CommandRename]($BaseUrl/$FullModuleName$View)"
163+
$Folder = $View.Split("=")[1]
164+
$ConfirmFile = Join-Path $WorkLoadDocsPath "$Folder" "$FullModuleName" "$BetaCommand.md"
163165
$ConfirmCommandAvailability = Find-MgGraphCommand -Command $CommandRename
164-
if ($ConfirmCommandAvailability) {
166+
if ($ConfirmCommandAvailability -and (Test-Path $ConfirmFile)) {
165167
(Get-Content $File) |
166168
Foreach-Object { $_ -replace '## SYNTAX', $Link -replace '## RELATED LINKS', $LinkOnEndOfDoc } |
167169
Out-File $File

0 commit comments

Comments
 (0)