Please perform the following steps:
- First of all, let's see if there already is a command available, as follows:
# Search for appropriate commands - all of them are externalGet-Command -Name *user*
- useradd and adduser are typically used on Linux systems to create local accounts on the fly, as shown in the following example:
# With useradd we can pass a password - but it has to be hashedman useradd
- These commands, however, expect a password hashed in a certain way. So let's start by getting a credential in a secure way, as shown in the following example:
$credential = Get-Credential -UserName notImportant
- While the current user can still access the plaintext password that the Linux command needs, the credential is still ...