Skip to content

Commit

Permalink
Merge branch 'feature/teamwork-tag-list' of https://github.com/gautam…
Browse files Browse the repository at this point in the history
…dsheth/powershell into feature/teamwork-tag-list
  • Loading branch information
gautamdsheth committed Oct 4, 2022
2 parents d419257 + e0bd2df commit 1aab699
Show file tree
Hide file tree
Showing 6 changed files with 5,401 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build/Build-Nightly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ if ($runPublish -eq $true) {
exit 1
}

# Generate predictor commands
./build/Generate-PredictorCommands.ps1 -Version $version

Write-Host "Generating Documentation" -ForegroundColor Yellow
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PlatyPS -ErrorAction Stop
Expand All @@ -208,7 +211,4 @@ if ($runPublish -eq $true) {

# Write version back to version
Set-Content ./version.txt -Value $version -Force -NoNewline

# Generate predictor commands
./build/Generate-PredictorCommands.ps1 -Version $version
}
15 changes: 12 additions & 3 deletions build/Generate-PredictorCommands.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ try {
# get all files in the srcfiles folder
$files = Get-ChildItem -Path ".\documentation" -Filter "*.md" -Recurse;

# set id to 1
$id = 1;

# loop through each file
$files | ForEach-Object {

# get file name without extension
$baseName = $_.BaseName.ToLower();
$baseName = $_.BaseName;

# get the file data
$fileData = Get-Content $_.FullName -Raw;
Expand All @@ -28,7 +31,10 @@ try {
$pattern = "(?s)(?<=### EXAMPLE .*``````)(.*?)(?=``````)";
}

$result = [regex]::Matches($fileData, $pattern);
# ignore case for regex
$options = [Text.RegularExpressions.RegexOptions]'IgnoreCase, CultureInvariant'

$result = [regex]::Matches($fileData, $pattern, $options);

$i = 1;
foreach ($item in $result) {
Expand All @@ -40,12 +46,15 @@ try {


# if the item value begins with the name of the file then add it to the json
if ($value.ToLower() -match "^$($baseName).*") {
if ($value.ToLower() -match "^$($baseName.ToLower()).*") {
$json += @{
"CommandName" = $baseName
"Command" = $value
"Rank" = $i
"Id" = $id
}
$i++;
$id++;
}
}

Expand Down
4 changes: 2 additions & 2 deletions documentation/Request-PnPSyntexClassifyAndExtract.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Request-PnPSyntexClassifyAndExtract
schema: 2.0.0
applicable: SharePoint Online
external help file: PnP.PowerShell.dll-Help.xml
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPPage.html
online version: https://pnp.github.io/powershell/cmdlets/Request-PnPSyntexClassifyAndExtract.html
---

# Request-PnPSyntexClassifyAndExtract
Expand Down Expand Up @@ -91,7 +91,7 @@ Accept wildcard characters: False
### -List
The name or list holding the files to classify and extract
The name or list holding the files to classify and extract.
```yaml
Type: ListPipeBind
Expand Down
2 changes: 1 addition & 1 deletion pnpframework_hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
83eaf1f88370b8fd35245a3ce2a01272178f4869
fc45d78d70cf3c54519978d080757a2ec00b6160
Loading

0 comments on commit 1aab699

Please sign in to comment.