Skip to content

Commit 79b68e6

Browse files
committed
More doc cleanup
1 parent b4ec7f6 commit 79b68e6

6 files changed

+53
-19
lines changed

.build/buildPsake.ps1

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,38 @@ task Docs {
338338
# Don't add "SYNOPSIS" header.
339339
# Ref: https://apastyle.apa.org/style-grammar-guidelines/paper-format/headings#:~:text=Headings%20in%20the%20introduction
340340
Write-Host ('[PSAKE Docs] Removing: {0}' -f $line) -ForegroundColor 'DarkMagenta'
341-
} elseif ($line -match '\\([[\]`])') {
342-
# https://regex101.com/r/a7QMx3
341+
} elseif (($line.Trim() -eq '## OUTPUTS') -or $inOutputs) {
342+
if ($inOutputs) {
343+
if ($line.Trim().StartsWith('## ')) {
344+
$inOutputs = $false
345+
Write-Output $line
346+
} elseif ($line.Trim().StartsWith('### ')) {
347+
Write-Host ('[PSAKE Docs] Editing:{1}{0}' -f $line, "`t") -ForegroundColor 'DarkMagenta'
348+
$newline = '`{0}`' -f $line.Trim().Substring(4)
349+
Write-Host ('{1}{1}>>{1}{0}' -f $newline, "`t") -ForegroundColor 'DarkMagenta'
350+
Write-Output $newline
351+
}
352+
} else {
353+
$inOutputs = $true
354+
Write-Output $line
355+
}
356+
} elseif (($line.Trim() -eq '### EXAMPLE') -or $inExample) {
357+
if ($inExample) {
358+
if ($line.Trim().StartsWith('```')) {
359+
Write-Host ('[PSAKE Docs] Editing:{1}{0}' -f $line, "`t") -ForegroundColor 'DarkMagenta'
360+
$newline = '```powershell'
361+
Write-Host ('{1}{1}>>{1}{0}' -f $newline, "`t") -ForegroundColor 'DarkMagenta'
362+
Write-Output $newline
363+
$inExample = $false
364+
}
365+
} else {
366+
$inExample = $true
367+
Write-Output $line
368+
}
369+
} elseif ($line -match '\\([[\]`\>])') {
370+
# https://regex101.com/r/pBXaJE/3
343371
Write-Host ('[PSAKE Docs] Editing:{1}{0}' -f $line, "`t") -ForegroundColor 'DarkMagenta'
344-
$newline = $line -replace '\\([[\]`])', '$1'
372+
$newline = $line -replace '\\([[\]`\>)', '$1'
345373
Write-Host ('{1}{1}>>{1}{0}' -f $newline, "`t") -ForegroundColor 'DarkMagenta'
346374
Write-Output $newline
347375
} else {

PSRedstone/Public/Assert-RedstoneIsMutexAvailable.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Assert-RedstoneIsMutexAvailable -MutexName 'Global\_MSIExecute' -MutexWaitTimeIn
1717
.EXAMPLE
1818
Assert-RedstoneIsMutexAvailable -MutexName 'Global\_MSIExecute' -MutexWaitTimeInMilliseconds (New-TimeSpan -Seconds 60).TotalMilliseconds
1919
.NOTES
20-
Copyright (C) 2015 - PowerShell App Deployment Toolkit Team
21-
Copyright (C) 2023 - Raymond Piller (VertigoRay)
22-
2320
- [_MSIExecute Mutex](https://learn.microsoft.com/en-us/windows/win32/msi/-msiexecute-mutex)
21+
22+
> Copyright Ⓒ 2015 - PowerShell App Deployment Toolkit Team
23+
>
24+
> Copyright Ⓒ 2023 - Raymond Piller (VertigoRay)
2425
.LINK
2526
https://github.com/VertigoRay/PSRedstone/wiki/Functions/#assert-redstoneismutexavailable
2627
#>

PSRedstone/Public/Assert-RedstoneIsNonInteractiveShell.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Is the current process running in a non-interactive shell?
44
.DESCRIPTION
55
There are two ways to determine if the current process is in a non-interactive shell:
66
7-
- See if the user environment is makred as interactive.
8-
- See if powershell was launced with the -NonInteractive
7+
- See if the user environment is marked as interactive.
8+
- See if PowerShell was launched with the -NonInteractive
99
.EXAMPLE
1010
Assert-RedstoneIsNonInteractiveShell
1111
If you're typing this into PowerShell, you should see `$false`.

PSRedstone/Public/Get-RedstoneMsiExitCodeMessage.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Get-RedstoneMsiExitCodeMessage -MsiExitCode 1618
1313
This is an internal script function and should typically not be called directly.
1414
- https://learn.microsoft.com/en-us/previous-versions//aa368542(v=vs.85)
1515
16-
Copyright (C) 2015 - PowerShell App Deployment Toolkit Team
17-
Copyright (C) 2023 - Raymond Piller (VertigoRay)
16+
> Copyright Ⓒ 2015 - PowerShell App Deployment Toolkit Team
17+
>
18+
> Copyright Ⓒ 2023 - Raymond Piller (VertigoRay)
1819
.LINK
1920
https://github.com/VertigoRay/PSRedstone/wiki/Functions#get-redstonemsiexitcodemessage
2021
#>

PSRedstone/Public/Get-RedstoneMsiTableProperty.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ Get-RedstoneMsiTableProperty -Path 'C:\Package\AppDeploy.msi' -GetSummaryInforma
3333
.NOTES
3434
This is an internal script function and should typically not be called directly.
3535
36-
Copyright (C) 2015 - PowerShell App Deployment Toolkit Team
37-
Copyright (C) 2023 - Raymond Piller (VertigoRay)
36+
> Copyright Ⓒ 2015 - PowerShell App Deployment Toolkit Team
37+
>
38+
> Copyright Ⓒ 2023 - Raymond Piller (VertigoRay)
3839
.LINK
3940
https://github.com/VertigoRay/PSRedstone/wiki/Functions#get-redstonemsitableproperty
4041
#>

PSRedstone/Public/Invoke-RedstoneCmd.ps1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
.SYNOPSIS
33
Runs the given command in ComSpec (aka: Command Prompt).
44
.DESCRIPTION
5-
This just runs a command in ComSpec by passing it to `Invoke-RedstoneRun`.
5+
This just runs a command in ComSpec by passing it to `Invoke-RedstoneRun`. If you don't *need* ComSpec to run the command, it's normally best to just use `Invoke-RedstoneRun`.
66
7-
If you don't *need* ComSpec to run the command, it's normally best to just use `Invoke-RedstoneRun`.
7+
Returns the same object as `Invoke-RedstoneRun`
8+
9+
```
10+
@{
11+
'Process' = $proc; # The result from Start-Process; as returned from `Invoke-RedstoneRun`.
12+
'StdOut' = $stdout;
13+
'StdErr' = $stderr;
14+
}
15+
```
816
.PARAMETER Cmd
917
Under normal usage, the string passed in here just gets appended to `cmd.exe /c `.
1018
.PARAMETER KeepOpen
@@ -24,11 +32,6 @@ Applies /A: Causes the output of internal commands to a pipe or file to be ANSI
2432
Applies /U: Causes the output of internal commands to a pipe or file to be Unicode
2533
.OUTPUTS
2634
[Hashtable] As returned from `Invoke-RedstoneRun`.
27-
@{
28-
'Process' = $proc; # The result from Start-Process; as returned from `Invoke-RedstoneRun`.
29-
'StdOut' = $stdout;
30-
'StdErr' = $stderr;
31-
}
3235
.EXAMPLE
3336
Invoke-RedstoneCmd "MKLINK /D Temp C:\Temp"
3437
.LINK

0 commit comments

Comments
 (0)