mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-14 23:02:41 +02:00
Updated the manuals
This commit is contained in:
@ -6,7 +6,7 @@ This PowerShell script creates a new user account with an encrypted home directo
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
PS> ./new-user.ps1 [[-username] <String>] [<CommonParameters>]
|
||||
/home/markus/Repos/PowerShell/scripts/new-user.ps1 [[-username] <String>] [<CommonParameters>]
|
||||
|
||||
-username <String>
|
||||
|
||||
@ -25,7 +25,7 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./new-user.ps1 Joe
|
||||
✔️ Created new user 'Joe' with encrypted home directory in 11s.
|
||||
✅ Created user account 'Joe' with encrypted home directory in 11s.
|
||||
|
||||
```
|
||||
|
||||
@ -42,12 +42,12 @@ Script Content
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates a new user account
|
||||
Create a new user
|
||||
.DESCRIPTION
|
||||
This PowerShell script creates a new user account with an encrypted home directory.
|
||||
.EXAMPLE
|
||||
PS> ./new-user.ps1 Joe
|
||||
✔️ Created new user 'Joe' with encrypted home directory in 11s.
|
||||
✅ Created user account 'Joe' with encrypted home directory in 11s.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -61,13 +61,14 @@ try {
|
||||
$stopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if ($IsLinux) {
|
||||
& sudo apt install ecryptfs-utils
|
||||
& 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)s."
|
||||
"✅ Created user account '$username' with encrypted home directory in $($elapsed)s."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@ -75,4 +76,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 08/15/2024 09:50:51)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 11/08/2024 12:34:52)*
|
||||
|
Reference in New Issue
Block a user