Skip to content

Commit fbc8bcc

Browse files
committed
rolled back file
1 parent e1f2242 commit fbc8bcc

File tree

1 file changed

+15
-46
lines changed

1 file changed

+15
-46
lines changed

microsoftgraph/EscapeDisallowedHtmlTags.ps1

Lines changed: 15 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function Update-Files{
7575
)
7676
try{
7777
foreach($filePath in Get-ChildItem $ModuleDocsPath){
78-
Remove-BoilerPlate -FilePath $filePath -GraphProfile $GraphProfile -ModuleName $ModuleName
78+
Add-Back-Ticks -FilePath $filePath -GraphProfile $GraphProfile -ModuleName $ModuleName
7979
#Special-Escape -FilePath $FilePath -GraphProfile $GraphProfile -ModuleName $ModuleName
8080
#Start-Sleep -Seconds 5
8181
}
@@ -86,37 +86,6 @@ function Update-Files{
8686
Write-Host "`nError Item Name: "$_.Exception.ItemName
8787
}
8888
}
89-
function Remove-BoilerPlate{
90-
param (
91-
[ValidateNotNullOrEmpty()]
92-
[string] $FilePath,
93-
[string] $ModuleDocsPath,
94-
[ValidateSet("beta", "v1.0")]
95-
[string] $GraphProfile = "v1.0",
96-
[ValidateNotNullOrEmpty()]
97-
[string] $ModuleName = "Users"
98-
)
99-
100-
$val ="### Example 1: {{ Add title here }}"
101-
$Lines = 19
102-
$LinesLeftToRemove = 0
103-
$TargetContent = @()
104-
105-
(Get-Content $FilePath) | % {
106-
If($_ -match $val) {
107-
$LinesLeftToRemove = $Lines + 1
108-
}
109-
110-
If($LinesLeftToRemove -GT 0) {
111-
$LinesLeftToRemove--
112-
} Else {
113-
$TargetContent += $_
114-
}
115-
}
116-
Set-Content $FilePath $TargetContent
117-
git add $FilePath
118-
git commit -m "Removing boiler plate code $ModuleName-$GraphProfile"
119-
}
12089
function Add-Back-Ticks{
12190
param (
12291
[ValidateNotNullOrEmpty()]
@@ -278,20 +247,20 @@ try{
278247
}
279248
return "NA"
280249
}
281-
# Set-Location microsoftgraph-docs-powershell
282-
# $date = Get-Date -Format "dd-MM-yyyy"
283-
# $proposedBranch = "weekly_update_help_files_"+$date
284-
# $exists = git branch -l $proposedBranch
285-
# if ([string]::IsNullOrEmpty($exists)) {
286-
# git checkout -b $proposedBranch
287-
# }else{
288-
# Write-Host "Branch already exists"
289-
# $currentBranch = git rev-parse --abbrev-ref HEAD
290-
# if($currentBranch -ne $proposedBranch){
291-
# git checkout $proposedBranch
292-
# }
293-
# git checkout $proposedBranch
294-
# }
250+
Set-Location microsoftgraph-docs-powershell
251+
$date = Get-Date -Format "dd-MM-yyyy"
252+
$proposedBranch = "weekly_update_help_files_"+$date
253+
$exists = git branch -l $proposedBranch
254+
if ([string]::IsNullOrEmpty($exists)) {
255+
git checkout -b $proposedBranch
256+
}else{
257+
Write-Host "Branch already exists"
258+
$currentBranch = git rev-parse --abbrev-ref HEAD
259+
if($currentBranch -ne $proposedBranch){
260+
git checkout $proposedBranch
261+
}
262+
git checkout $proposedBranch
263+
}
295264
Escape-Angle-Brackets -ModulesToGenerate $ModulesToGenerate
296265
#cd microsoftgraph-docs-powershell
297266
Write-Host -ForegroundColor Green "-------------Done-------------"

0 commit comments

Comments
 (0)