Skip to content

Commit 09eb3d1

Browse files
committed
Updated the manuals
1 parent b3cdf19 commit 09eb3d1

File tree

651 files changed

+8355
-1398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

651 files changed

+8355
-1398
lines changed

docs/add-firewall-rules.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Parameters
1515
Position? 1
1616
Default value
1717
Accept pipeline input? false
18+
Aliases
1819
Accept wildcard characters? false
1920
2021
-Direction <String>
@@ -24,6 +25,7 @@ Parameters
2425
Position? 2
2526
Default value Inbound
2627
Accept pipeline input? false
28+
Aliases
2729
Accept wildcard characters? false
2830
2931
-FirewallProfile <Array>
@@ -32,6 +34,7 @@ Parameters
3234
Position? 3
3335
Default value @("Domain", "Private")
3436
Accept pipeline input? false
37+
Aliases
3538
Accept wildcard characters? false
3639
3740
[<CommonParameters>]
@@ -113,4 +116,4 @@ try {
113116
114117
```
115118

116-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
119+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

docs/alert.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Parameters
1515
Position? 1
1616
Default value
1717
Accept pipeline input? false
18+
Aliases
1819
Accept wildcard characters? false
1920
2021
[<CommonParameters>]
@@ -71,4 +72,4 @@ try {
7172
}
7273
```
7374

74-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
75+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

docs/build-repo.md

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
The *build-repo.ps1* Script
22
===========================
33

4-
This PowerShell script builds a Git repository by supporting build systems such as: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
4+
This PowerShell script builds a Git repository by supporting the build systems: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
55

66
Parameters
77
----------
88
```powershell
99
/Repos/PowerShell/scripts/build-repo.ps1 [[-path] <String>] [<CommonParameters>]
1010
1111
-path <String>
12-
Specifies the path to the Git repository (default is current working directory)
12+
Specifies the path to the Git repository (current working directory by default)
1313
1414
Required? false
1515
Position? 1
1616
Default value "$PWD"
1717
Accept pipeline input? false
18+
Aliases
1819
Accept wildcard characters? false
1920
2021
[<CommonParameters>]
@@ -26,9 +27,9 @@ Example
2627
-------
2728
```powershell
2829
PS> ./build-repo.ps1 C:\Repos\ninja
29-
⏳ Building 📂ninja using CMakeLists.txt into 📂ninja/_Build_Results...
30+
⏳ Building 📂ninja by using CMake...
3031
...
31-
Built 📂ninja repository in 47 sec.
32+
Build of 📂ninja succeeded in 47s, results in: 📂C:\Repos\ninja\_results
3233
3334
```
3435

@@ -45,16 +46,16 @@ Script Content
4546
```powershell
4647
<#
4748
.SYNOPSIS
48-
Builds a repository
49+
Builds a repo
4950
.DESCRIPTION
50-
This PowerShell script builds a Git repository by supporting build systems such as: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
51+
This PowerShell script builds a Git repository by supporting the build systems: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
5152
.PARAMETER path
52-
Specifies the path to the Git repository (default is current working directory)
53+
Specifies the path to the Git repository (current working directory by default)
5354
.EXAMPLE
5455
PS> ./build-repo.ps1 C:\Repos\ninja
55-
⏳ Building 📂ninja using CMakeLists.txt into 📂ninja/_Build_Results...
56+
⏳ Building 📂ninja by using CMake...
5657
...
57-
Built 📂ninja repository in 47 sec.
58+
Build of 📂ninja succeeded in 47s, results in: 📂C:\Repos\ninja\_results
5859
.LINK
5960
https://github.com/fleschutz/PowerShell
6061
.NOTES
@@ -63,114 +64,114 @@ Script Content
6364
6465
param([string]$path = "$PWD")
6566
66-
function BuildInDir([string]$path) {
67+
function BuildFolder([string]$path) {
6768
$dirName = (Get-Item "$path").Name
6869
if (Test-Path "$path/CMakeLists.txt" -pathType leaf) {
69-
"⏳ (1/4) Building 📂$dirName by using CMake into 📂$dirName/_Build_Results..."
70-
if (-not(Test-Path "$path/_Build_Results/" -pathType container)) {
71-
& mkdir "$path/_Build_Results/"
70+
"⏳ (1/4) Building 📂$dirName by using CMake..."
71+
$global:results = "$path/_results/"
72+
if (-not(Test-Path $global:results -pathType container)) {
73+
& mkdir $global:results
7274
}
73-
Set-Location "$path/_Build_Results/"
75+
Set-Location $global:results
7476
7577
"⏳ (2/4) Executing 'cmake' to generate the Makefile..."
7678
& cmake ..
77-
if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' exited with error code $lastExitCode" }
79+
if ($lastExitCode -ne 0) { throw "Executing 'cmake ..' failed with exit code $lastExitCode" }
7880
7981
"⏳ (3/4) Executing 'make -j4' to compile and link..."
8082
& make -j4
81-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' exited with error code $lastExitCode" }
83+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
8284
83-
"⏳ (4/4) Executing 'ctest -V' to perform tests (optional)..."
85+
"⏳ (4/4) Executing 'ctest -V'... (if tests are provided)"
8486
& ctest -V
85-
if ($lastExitCode -ne "0") { throw "Executing 'ctest -V' exited with error code $lastExitCode" }
86-
87+
if ($lastExitCode -ne 0) { throw "Executing 'ctest -V' failed with exit code $lastExitCode" }
8788
} elseif (Test-Path "$path/autogen.sh" -pathType leaf) {
88-
"⏳ Building 📂$dirName by using 'autogen.sh'..."
89+
"⏳ Building 📂$dirName by executing 'autogen.sh'..."
8990
Set-Location "$path/"
90-
9191
& ./autogen.sh --force
92-
if ($lastExitCode -ne "0") { throw "Executing './autogen.sh --force' exited with error code $lastExitCode" }
92+
if ($lastExitCode -ne 0) { throw "Executing './autogen.sh --force' failed with exit code $lastExitCode" }
93+
"⏳ Executing './configure'..."
9394
9495
& ./configure
95-
if ($lastExitCode -ne "0") { throw "Executing './configure' exited with error code $lastExitCode" }
96+
if ($lastExitCode -ne 0) { throw "Executing './configure' failed with exit code $lastExitCode" }
9697
9798
& make -j4
98-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' exited with error code $lastExitCode" }
99-
99+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
100100
101101
} elseif (Test-Path "$path/configure" -pathType leaf) {
102-
"⏳ Building 📂$dirName by using 'configure'..."
102+
"⏳ Building 📂$dirName by executing './configure' and 'make'..."
103103
Set-Location "$path/"
104104
105105
& ./configure
106-
#if ($lastExitCode -ne "0") { throw "Executing './configure' exited with error code $lastExitCode" }
106+
#if ($lastExitCode -ne 0) { throw "Executing './configure' exited with error code $lastExitCode" }
107107
108108
& make -j4
109-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
109+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
110110
111111
& make test
112-
if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" }
112+
if ($lastExitCode -ne 0) { throw "Executing 'make test' failed with exit code $lastExitCode" }
113113
114114
} elseif (Test-Path "$path/build.gradle" -pathType leaf) {
115115
"⏳ Building 📂$dirName by using Gradle..."
116116
Set-Location "$path"
117117
118118
& gradle build
119-
if ($lastExitCode -ne "0") { throw "Executing 'gradle build' exited with error code $lastExitCode" }
119+
if ($lastExitCode -ne 0) { throw "Executing 'gradle build' failed with exit code $lastExitCode" }
120120
121121
& gradle test
122-
if ($lastExitCode -ne "0") { throw "Executing 'gradle test' exited with error code $lastExitCode" }
122+
if ($lastExitCode -ne 0) { throw "Executing 'gradle test' failed with exit code $lastExitCode" }
123123
124124
} elseif (Test-Path "$path/meson.build" -pathType leaf) {
125125
"⏳ Building 📂$dirName by using Meson..."
126126
Set-Location "$path"
127127
& meson . build --prefix=/usr/local
128-
if ($lastExitCode -ne "0") { throw "Executing 'meson . build' exited with error code $lastExitCode" }
128+
if ($lastExitCode -ne 0) { throw "Executing 'meson . build' failed with exit code $lastExitCode" }
129129
130130
} elseif (Test-Path "$path/Imakefile" -pathType leaf) {
131131
"⏳ Building 📂$dirName by using Imakefile..."
132132
Set-Location "$path/"
133133
134134
& xmkmf
135-
if ($lastExitCode -ne "0") { throw "Executing 'xmkmf' has failed" }
135+
if ($lastExitCode -ne 0) { throw "Executing 'xmkmf' failed with exit code $lastExitCode" }
136136
137137
& make -j4
138-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
138+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
139139
140140
} elseif (Test-Path "$path/Makefile" -pathType leaf) {
141141
"⏳ Building 📂$dirName by using Makefile..."
142142
Set-Location "$path"
143143
144144
& make -j4
145-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
145+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
146146
147147
} elseif (Test-Path "$path/makefile" -pathType leaf) {
148148
"⏳ Building 📂$dirName by using makefile..."
149149
Set-Location "$path"
150150
151151
& make -j4
152-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
152+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
153153
154154
} elseif (Test-Path "$path/compile.sh" -pathType leaf) {
155-
"⏳ Building 📂$dirName by using 'compile.sh'..."
155+
"⏳ Building 📂$dirName by executing 'compile.sh'..."
156156
Set-Location "$path/"
157157
158158
& ./compile.sh
159-
if ($lastExitCode -ne "0") { throw "Executing './compile.sh' exited with error code $lastExitCode" }
159+
if ($lastExitCode -ne 0) { throw "Executing './compile.sh' failed with exit code $lastExitCode" }
160160
161161
& make -j4
162-
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
162+
if ($lastExitCode -ne 0) { throw "Executing 'make -j4' failed with exit code $lastExitCode" }
163163
164164
} elseif (Test-Path "$path/attower/src/build/DevBuild/build.bat" -pathType leaf) {
165-
"⏳ Building 📂$dirName by using build.bat ..."
166-
Set-Location "$path/attower/src/build/DevBuild/"
167165
168-
& ./build.bat build-all-release
169-
if ($lastExitCode -ne "0") { throw "Executing 'build.bat build-all-release' exited with error code $lastExitCode" }
166+
Write-Host "⏳ Building 📂$dirName by executing 'build.bat'..."
167+
Set-Location "$path/attower/src/build/DevBuild/"
168+
& ./build.bat build-core-release
169+
if ($lastExitCode -ne 0) { throw "Executing 'build.bat' failed with exit code $lastExitCode" }
170+
$global:results = "$path\attower\Executables"
170171
171172
} elseif (Test-Path "$path/$dirName" -pathType container) {
172173
"⏳ No make rule found, trying subfolder 📂$($dirName)..."
173-
BuildInDir "$path/$dirName"
174+
BuildFolder "$path/$dirName"
174175
} else {
175176
Write-Warning "Sorry, no make rule applies to: 📂$dirName"
176177
exit 0 # success
@@ -179,21 +180,27 @@ function BuildInDir([string]$path) {
179180
180181
try {
181182
$stopWatch = [system.diagnostics.stopwatch]::startNew()
183+
$previousPath = Get-Location
182184
183-
if (-not(Test-Path "$path" -pathType container)) { throw "Can't access directory: $path" }
185+
if (-not(Test-Path "$path" -pathType container)) { throw "The file path '$path' doesn't exist (yet)" }
184186
185-
$previousPath = Get-Location
186-
BuildInDir "$path"
187+
$global:results = ""
188+
BuildFolder "$path"
187189
Set-Location "$previousPath"
188190
189191
$repoDirName = (Get-Item "$path").Name
190192
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
191-
"✅ Built 📂$repoDirName repository in $elapsed sec."
193+
if ($global:results -eq "") {
194+
"✅ Build of 📂$repoDirName succeeded in $($elapsed)s."
195+
} else {
196+
"✅ Build of 📂$repoDirName succeeded in $($elapsed)s, results in: 📂$($global:results)"
197+
}
192198
exit 0 # success
193199
} catch {
194200
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
201+
Set-Location "$previousPath"
195202
exit 1
196203
}
197204
```
198205

199-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
206+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

docs/build-repos.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Parameters
1515
Position? 1
1616
Default value "$PWD"
1717
Accept pipeline input? false
18+
Aliases
1819
Accept wildcard characters? false
1920
2021
[<CommonParameters>]
@@ -82,4 +83,4 @@ try {
8283
}
8384
```
8485

85-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
86+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

docs/cd-autostart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ Script Content
4949
try {
5050
$path = Resolve-Path "~/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup"
5151
if (-not(Test-Path "$path" -pathType container)) {
52-
throw "Autostart folder at 📂$path doesn't exist (yet)"
52+
throw "No autostart folder at 📂$path"
5353
}
5454
Set-Location "$path"
5555
"📂$path"
5656
exit 0 # success
5757
} catch {
58-
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
58+
"⚠️ Error: $($Error[0])"
5959
exit 1
6060
}
6161
```
6262

63-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
63+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

docs/cd-crashdumps.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Example
1717
-------
1818
```powershell
1919
PS> ./cd-crashdumps
20-
📂C:\Users\Markus\AppData\Local\CrashDumps
20+
📂C:\Users\Markus\AppData\Local\CrashDumps entered (has 3 files and 0 folders)
2121
2222
```
2323

@@ -39,7 +39,7 @@ Script Content
3939
This PowerShell script changes the working directory to the crash dumps directory (Windows only). Whenever a software crashes and crash dumps are enabled(!) a crash dump file is written. This file helps to identify the reason for the crash.
4040
.EXAMPLE
4141
PS> ./cd-crashdumps
42-
📂C:\Users\Markus\AppData\Local\CrashDumps
42+
📂C:\Users\Markus\AppData\Local\CrashDumps entered (has 3 files and 0 folders)
4343
.LINK
4444
https://github.com/fleschutz/PowerShell
4545
.NOTES
@@ -50,17 +50,19 @@ try {
5050
if ($IsLinux) { throw "Sorry, Windows only" }
5151
5252
[string]$path = Resolve-Path -Path "~"
53-
if (!(Test-Path "$path" -pathType container)) { throw "Home directory at $path doesn't exist (yet)" }
53+
if (!(Test-Path "$path" -pathType container)) { throw "No home directory at $path" }
5454
5555
$path += "\AppData\Local\CrashDumps"
56-
if (!(Test-Path "$path" -pathType container)) { throw "Crashdumps directory at $path doesn't exist (yet)" }
56+
if (!(Test-Path "$path" -pathType container)) { throw "No crashdumps folder at $path" }
5757
Set-Location "$Path"
58-
"📂$path"
58+
$files = Get-ChildItem $path -attributes !Directory
59+
$folders = Get-ChildItem $path -attributes Directory
60+
"📂$path entered (has $($files.Count) files and $($folders.Count) folders)"
5961
exit 0 # success
6062
} catch {
61-
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
63+
"⚠️ Error: $($Error[0])"
6264
exit 1
6365
}
6466
```
6567

66-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
68+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

docs/cd-desktop.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,24 @@ Script Content
4747
#>
4848
4949
try {
50-
if ($IsLinux) {
50+
if ($IsLinux -or $IsMacOS) {
51+
if (-not(Test-Path "~/Desktop" -pathType container)) {
52+
throw "No 📂Desktop folder in your home directory yet"
53+
}
5154
$path = Resolve-Path "~/Desktop"
5255
} else {
5356
$path = [Environment]::GetFolderPath('DesktopDirectory')
57+
if (-not(Test-Path "$path" -pathType container)) {
58+
throw "No desktop folder at 📂$path yet"
59+
}
5460
}
55-
if (Test-Path "$path" -pathType container) {
56-
Set-Location "$path"
57-
"📂$path"
58-
exit 0 # success
59-
}
60-
throw "User's desktop folder at 📂$path doesn't exist (yet)"
61+
Set-Location "$path"
62+
"📂$path"
63+
exit 0 # success
6164
} catch {
62-
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
65+
"⚠️ Error: $($Error[0])"
6366
exit 1
6467
}
6568
```
6669

67-
*(page generated by convert-ps2md.ps1 as of 01/23/2025 12:15:19)*
70+
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:52)*

0 commit comments

Comments
 (0)