From ddbf8d33ef97ba12baa8ffe21d0c88b965cdd546 Mon Sep 17 00:00:00 2001 From: Luca Poldelmengo Date: Fri, 15 Mar 2019 11:47:02 +0100 Subject: [PATCH] Add prompt to exit the script Prevent the script to be closed automatically if you run it by right clicking the file and choose *Run with PowerShell* --- pwned-search.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pwned-search.ps1 b/pwned-search.ps1 index 5a25afa..914d163 100644 --- a/pwned-search.ps1 +++ b/pwned-search.ps1 @@ -1,4 +1,4 @@ -$string = Read-Host -Prompt 'Password to check' +$string = Read-Host -Prompt 'Password to check' $bytes = [System.Text.Encoding]::UTF8.GetBytes($string) $sha1 = New-Object System.Security.Cryptography.SHA1CryptoServiceProvider $data = $sha1.ComputeHash($bytes) @@ -20,3 +20,5 @@ while (($line = $reader.ReadLine()) -ne $null) { } } if ($found -eq 0) { Write-Host "That password was not found." } + +Read-Host -Prompt "Press Enter to exit"