Updated the manuals

This commit is contained in:
Markus Fleschutz
2025-06-22 10:38:33 +02:00
parent df7368ff91
commit d8690419ea
661 changed files with 1512 additions and 966 deletions

View File

@ -1,7 +1,7 @@
The *new-text-file.ps1* Script
===========================
This PowerShell script creates a new .txt file from template file at: ../data/templates/Text.txt.
This PowerShell script creates a new .txt file from: ../data/templates/New.txt.
Parameters
----------
@ -9,11 +9,11 @@ Parameters
/Repos/PowerShell/scripts/new-text-file.ps1 [[-path] <String>] [<CommonParameters>]
-path <String>
Specifies the path and new filename
Specifies the path and new filename (README.txt by default)
Required? false
Position? 1
Default value
Default value README.txt
Accept pipeline input? false
Aliases
Accept wildcard characters? false
@ -26,8 +26,8 @@ Parameters
Example
-------
```powershell
PS> ./new-text-file.ps1 README.txt
New text file 'README.txt' created from template 'Text.txt'.
PS> ./new-text-file.ps1
New 'README.txt' created (from data/templates/New.txt).
```
@ -44,30 +44,30 @@ Script Content
```powershell
<#
.SYNOPSIS
Creates a new text file
Creates a text file
.DESCRIPTION
This PowerShell script creates a new .txt file from template file at: ../data/templates/Text.txt.
This PowerShell script creates a new .txt file from: ../data/templates/New.txt.
.PARAMETER path
Specifies the path and new filename
Specifies the path and new filename (README.txt by default)
.EXAMPLE
PS> ./new-text-file.ps1 README.txt
✅ New text file 'README.txt' created from template 'Text.txt'.
PS> ./new-text-file.ps1
✅ New 'README.txt' created (from data/templates/New.txt).
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
param([string]$path = "")
param([string]$path = "README.txt")
try {
if ($path -eq "" ) { $path = Read-Host "Enter the new filename" }
if (Test-Path "$path" -pathType leaf) { throw "File '$path' is already existing" }
$pathToTemplate = Resolve-Path "$PSScriptRoot/../data/templates/Text.txt"
$pathToTemplate = Resolve-Path "$PSScriptRoot/../data/templates/New.txt"
Copy-Item $pathToTemplate "$path"
if ($lastExitCode -ne 0) { throw "Can't copy template to: $path" }
"✅ New text file '$path' created from template 'Text.txt'."
"✅ New '$path' created (from data/templates/New.txt)."
exit 0 # success
} catch {
"⚠️ Error: $($Error[0])"
@ -75,4 +75,4 @@ try {
}
```
*(page generated by convert-ps2md.ps1 as of 05/12/2025 22:02:56)*
*(page generated by convert-ps2md.ps1 as of 06/22/2025 10:37:39)*