From 7684d98b1cad07c2f81ec5da29c43428f987934c Mon Sep 17 00:00:00 2001 From: ~#M?x <89079595+suchsoak@users.noreply.github.com> Date: Sun, 7 Jan 2024 19:15:29 -0300 Subject: [PATCH] Create password.md --- Doc/password.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Doc/password.md diff --git a/Doc/password.md b/Doc/password.md new file mode 100644 index 0000000..c015fa9 --- /dev/null +++ b/Doc/password.md @@ -0,0 +1,31 @@ + +```sh + _ __ _ +| '_ \ __ _ ___ ___ _ __ __ ___ _ _ __| | +| .__// _` |(_-/(_-/ \ V V // _ \| '_|/ _` | +|_| \__/_|/__//__/ \_/\_/ \___/|_| \__/_| +Github:github.com/suchsoak +BY: suchsok +``` + +The script starts by displaying the value of the variable $pass using the Write-Host command. This is likely to provide some context or instruction to the user. + +The script then prompts the user to enter a password using the Read-Host command. The entered password is stored in the variable `$password`. + +Next, the script prompts the user to enter a file path using the Read-Host command. The entered file path is stored in the variable $way. + +The script then uses the `ConvertTo-SecureString` command to convert the password into a secure string. The -String parameter specifies the password to be converted, and the -AsPlainText parameter indicates that the password is provided as plain text. The resulting secure string is stored in the variable $secureString. + +The script uses the `ConvertFrom-SecureString` command to convert the secure string into an encrypted standard string. This encrypted string is then written to a file specified by the $way variable using the Set-Content command. + +The script checks if the $secureString variable has a value. If it does, it displays the message `"Password saved!"` using the Write-Host command. This indicates that the password was successfully saved to the file. + +If the $secureString variable does not have a value, the script displays the message `"Had a Problem, verify the path!!"` using the Write-Host command. This suggests that there was an issue with the file path provided by the user. + +The script includes a catch block, which is used to handle any errors that may occur during the execution of the previous commands. If an error occurs, the script displays the message "There was an error with the previous command. Please try again." using the Write-Host command. + +In summary, this script allows the user to enter a password and a file path, and then securely saves the password to the specified file. + +|scrip| link | +|-----|------| +|password.ps1| https://github.com/suchsoak/Powershell_script/tree/main/powershell