-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |