Updated the Markdown manuals

This commit is contained in:
Markus Fleschutz
2023-12-07 20:24:45 +01:00
parent dafa6cf1d7
commit 1ffd91c5e2
605 changed files with 1927 additions and 1015 deletions

View File

@ -1,14 +1,14 @@
*new-user.ps1*
================
This PowerShell script creates a new user account.
This PowerShell script creates a new user account with an encrypted home directory.
Parameters
----------
```powershell
PS> ./new-user.ps1 [[-Username] <String>] [<CommonParameters>]
PS> ./new-user.ps1 [[-username] <String>] [<CommonParameters>]
-Username <String>
-username <String>
Required? false
Position? 1
@ -24,7 +24,8 @@ PS> ./new-user.ps1 [[-Username] <String>] [<CommonParameters>]
Example
-------
```powershell
PS> ./new-user.ps1
PS> ./new-user.ps1 Joe
Created new user 'Joe' with encrypted home directory in 11 sec
```
@ -43,29 +44,30 @@ Script Content
.SYNOPSIS
Creates a new user account
.DESCRIPTION
This PowerShell script creates a new user account.
This PowerShell script creates a new user account with an encrypted home directory.
.EXAMPLE
PS> ./new-user.ps1
PS> ./new-user.ps1 Joe
✔️ Created new user 'Joe' with encrypted home directory in 11 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
param([string]$Username = "")
param([string]$username = "")
try {
if ($Username -eq "") { $Username = Read-Host "Enter new user name" }
$StopWatch = [system.diagnostics.stopwatch]::startNew()
if ($username -eq "") { $username = Read-Host "Enter the new user name" }
$stopWatch = [system.diagnostics.stopwatch]::startNew()
if ($IsLinux) {
& sudo adduser --encrypt-home $Username
& sudo adduser --encrypt-home $username
} else {
throw "Not supported yet"
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ created new user '$Username' with encrypted home directory in $Elapsed sec"
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"✔️ Created new user '$username' with encrypted home directory in $elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
@ -73,4 +75,4 @@ try {
}
```
*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 10/19/2023 08:11:40)*
*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 12/07/2023 20:24:20)*