mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-18 08:30:00 +02:00
Update manuals
This commit is contained in:
@@ -24,12 +24,10 @@ function GetCode { param($Example)
|
||||
|
||||
$code = New-Object "System.Collections.Generic.List[string]"
|
||||
for ($i = 0; $i -lt $codeAndRemarks.Length; $i++) {
|
||||
if ($codeAndRemarks[$i] -eq 'DESCRIPTION' -and $codeAndRemarks[$i + 1] -eq '-----------') {
|
||||
break
|
||||
}
|
||||
if (1 -le $i -and $i -le 2) {
|
||||
continue
|
||||
}
|
||||
if ($codeAndRemarks[$i] -eq 'DESCRIPTION' -and $codeAndRemarks[$i + 1] -eq '-----------') { break }
|
||||
if ($codeAndRemarks[$i] -eq '' -and $codeAndRemarks[$i + 1] -eq '') { continue }
|
||||
if (1 -le $i -and $i -le 2) { continue }
|
||||
$codeAndRemarks[$i] = ($codeAndRemarks[$i] | Out-String) -replace "PS>","PS> "
|
||||
$code.Add($codeAndRemarks[$i])
|
||||
}
|
||||
|
||||
|
@@ -5,8 +5,8 @@
|
||||
This script exports the comment based help of all PowerShell scripts as manuals.
|
||||
.EXAMPLE
|
||||
PS> ./export-to-manuals.ps1
|
||||
Found 264 scripts, exporting to /home/markus/PowerShell/Docs...
|
||||
✔️ exported 264 scripts as manuals in 28 sec
|
||||
Exporting 264 PowerShell scripts to /home/markus/PowerShell/Docs...
|
||||
✔️ exported 264 PowerShell scripts in 28 sec
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
@@ -21,14 +21,14 @@ try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
$Scripts = Get-ChildItem "$FilePattern"
|
||||
"⏳ Exporting $($Scripts.Count) scripts to $TargetDir..."
|
||||
"⏳ Exporting $($Scripts.Count) PowerShell scripts to $TargetDir..."
|
||||
|
||||
foreach ($Script in $Scripts) {
|
||||
& "$PSScriptRoot/convert-ps2md" "$Script" > "$TargetDir/$($Script.BaseName).md"
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ exported $($Scripts.Count) scripts as manuals in $Elapsed sec"
|
||||
"✔️ exported $($Scripts.Count) PowerShell scripts in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@@ -17,16 +17,16 @@ try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if ($IsLinux) {
|
||||
"⏳ Fetching update infos for installed Debian packages (step 1/4)..."
|
||||
"⏳ Fetching update infos for installed Debian packages [step 1/4]..."
|
||||
& sudo apt update
|
||||
|
||||
"⏳ Upgrading installed Debian packages (step 2/4)..."
|
||||
"⏳ Upgrading installed Debian packages [step 2/4]..."
|
||||
& sudo apt upgrade --yes
|
||||
|
||||
"⏳ Removing obsolete Debian packages (step 3/4)..."
|
||||
"⏳ Removing obsolete Debian packages [step 3/4]..."
|
||||
& sudo apt autoremove --yes
|
||||
|
||||
"⏳ Upgrading installed Snap packages (step 4/4)..."
|
||||
"⏳ Upgrading installed Snap packages [step 4/4]..."
|
||||
& sudo snap refresh
|
||||
} else {
|
||||
"Sorry, not supported yet"
|
||||
|
@@ -11,6 +11,7 @@
|
||||
Specifies the message text to send
|
||||
.EXAMPLE
|
||||
PS> ./send-udp 192.168.100.100 8080 "TEST"
|
||||
✔️ Done.
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
|
Reference in New Issue
Block a user