@@ -75,7 +75,7 @@ function Update-Files{
75
75
)
76
76
try {
77
77
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
79
79
# Special-Escape -FilePath $FilePath -GraphProfile $GraphProfile -ModuleName $ModuleName
80
80
# Start-Sleep -Seconds 5
81
81
}
@@ -86,37 +86,6 @@ function Update-Files{
86
86
Write-Host " `n Error Item Name: " $_.Exception.ItemName
87
87
}
88
88
}
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
- }
120
89
function Add-Back-Ticks {
121
90
param (
122
91
[ValidateNotNullOrEmpty ()]
@@ -278,20 +247,20 @@ try{
278
247
}
279
248
return " NA"
280
249
}
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
+ }
295
264
Escape- Angle- Brackets - ModulesToGenerate $ModulesToGenerate
296
265
# cd microsoftgraph-docs-powershell
297
266
Write-Host - ForegroundColor Green " -------------Done-------------"
0 commit comments