Skip to content

Commit 65bf605

Browse files
committed
Rectified mistakes on the script
1 parent 6330d05 commit 65bf605

File tree

3 files changed

+32
-35
lines changed

3 files changed

+32
-35
lines changed

azure-pipelines/powershell-docs.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,37 @@ jobs:
5353
pwsh: true
5454
filePath: microsoftgraph-docs-powershell\scripts\FileCopy.ps1
5555

56-
# - task: PowerShell@2
57-
# displayName: 'Update Powershell Help'
58-
# continueOnError: false
59-
# inputs:
60-
# targetType: 'filePath'
61-
# pwsh: true
62-
# filePath: microsoftgraph-docs-powershell\microsoftgraph\UpdateHelp.ps1
56+
- task: PowerShell@2
57+
displayName: 'Update Powershell Help'
58+
continueOnError: false
59+
inputs:
60+
targetType: 'filePath'
61+
pwsh: true
62+
filePath: microsoftgraph-docs-powershell\microsoftgraph\UpdateHelp.ps1
6363

64-
# - task: PowerShell@2
65-
# displayName: 'Escape disallowed html tags'
66-
# continueOnError: false
67-
# inputs:
68-
# targetType: 'filePath'
69-
# pwsh: true
70-
# filePath: microsoftgraph-docs-powershell\microsoftgraph\EscapeDisallowedHtmlTags.ps1
64+
- task: PowerShell@2
65+
displayName: 'Escape disallowed html tags'
66+
continueOnError: false
67+
inputs:
68+
targetType: 'filePath'
69+
pwsh: true
70+
filePath: microsoftgraph-docs-powershell\microsoftgraph\EscapeDisallowedHtmlTags.ps1
7171

72-
# - task: PowerShell@2
73-
# displayName: 'Update metadata header'
74-
# continueOnError: false
75-
# inputs:
76-
# targetType: 'filePath'
77-
# pwsh: true
78-
# filePath: microsoftgraph-docs-powershell\scripts\MsProdUpdate.ps1
72+
- task: PowerShell@2
73+
displayName: 'Update metadata header'
74+
continueOnError: false
75+
inputs:
76+
targetType: 'filePath'
77+
pwsh: true
78+
filePath: microsoftgraph-docs-powershell\scripts\MsProdUpdate.ps1
7979

80-
# - task: PowerShell@2
81-
# displayName: 'Update Links'
82-
# continueOnError: false
83-
# inputs:
84-
# targetType: 'filePath'
85-
# pwsh: true
86-
# filePath: microsoftgraph-docs-powershell\scripts\UpdateLinks.ps1
80+
- task: PowerShell@2
81+
displayName: 'Update Links'
82+
continueOnError: false
83+
inputs:
84+
targetType: 'filePath'
85+
pwsh: true
86+
filePath: microsoftgraph-docs-powershell\scripts\UpdateLinks.ps1
8787

8888
- task: PowerShell@2
8989
displayName: Pushing to github
@@ -97,9 +97,9 @@ jobs:
9797
git config --global user.name "Timothy Wamalwa"
9898
cd microsoftgraph-docs-powershell
9999
$date = Get-Date -Format "dd-MM-yyyy"
100-
$proposedBranch = "File_copy_test1"
100+
$proposedBranch = "weekly_v2_docs_update_$date"
101101
git add .
102-
git commit -m "Updating help files "+$date
102+
git commit -m "Updating help files $date"
103103
git push --set-upstream "https://$(GITHUB_TOKEN)@github.com/MicrosoftDocs/microsoftgraph-docs-powershell.git" $proposedBranch
104104
git status
105105

scripts/FileCopy.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ function Copy-Files{
9898

9999

100100
Set-Location microsoftgraph-docs-powershell
101-
$date = Get-Date -Format "dd-MM-yyyy"
102-
#$proposedBranch = "weekly_v2_docs_update_$date"
101+
$proposedBranch = "weekly_v2_docs_update_$date"
103102
$proposedBranch = "File_copy_test1"
104103
$exists = git branch -l $proposedBranch
105104
if ([string]::IsNullOrEmpty($exists)) {

scripts/UpdateLinks.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,10 @@ function Add-Link {
148148
$CommandRename = $Command.Replace("-Mg", "-MgBeta")
149149
}
150150

151-
$Block = $Matches[0]
152151
$Link = "> [!NOTE]`n> $LinkTitle [$CommandRename]($BaseUrl/$FullModuleName$View)`r`n`n## SYNTAX"
153152
$LinkOnEndOfDoc = "## RELATED LINKS`r`n[$CommandRename]($BaseUrl/$FullModuleName$View)"
154-
$NewBlock = $Block.Replace("## SYNTAX", $Link)
155153
(Get-Content $File) |
156-
Foreach-Object { $_ -replace '## SYNTAX', $NewBlock -replace '## RELATED LINKS', $LinkOnEndOfDoc} |
154+
Foreach-Object { $_ -replace '## SYNTAX', $Link -replace '## RELATED LINKS', $LinkOnEndOfDoc} |
157155
Out-File $File
158156
}
159157
}

0 commit comments

Comments
 (0)