Save-Safecreds.ps1 bug fixed

This commit is contained in:
Federico Lillacci
2025-10-30 06:39:28 +01:00
committed by GitHub
parent 881f15f97f
commit c7e6faddb7
3 changed files with 13 additions and 5 deletions

View File

@@ -6,6 +6,11 @@ The format is based on https://keepachangelog.com/en/1.0.0/, and this project ad
Placeholder for upcoming changes.
## [2.0.1] - 2025-10-30
### Fixed
- Bug in Save-SafeCreds.ps1 preventing execution of the script fixed
## [2.0.0] - 2025-10-27
### Added

View File

@@ -1,5 +1,5 @@
#Script Info - please do not modify the following line
$scriptVersion = "2.0"
$scriptVersion = "2.0.1"
#Cluster Environment
$clusterDeployment = $false #Set to $true for a clustered environment

View File

@@ -29,13 +29,16 @@ if (Test-Path -Path $credsFile)
Write-Host -ForegroundColor Yellow "An encrypted XML file with creds already exists at this location"
$userChoice = Read-Host `
-Prompt "Do you want to overwrite it? Press Y and ENTER to continue, any other key to abort"
}
if ($userChoice -ne "y")
if ($userChoice -ne "y")
{
exit
}
}
Write-Host "File not exists"
#Prompting for username and password
Write-Host -ForegroundColor Yellow "Enter the credentials you want to save"
$Credentials = Get-Credential
@@ -54,12 +57,12 @@ try {
}
else
{
throw "There was a problem saving your credentials"
throw "There was a problem saving your credentials: $_"
}
}
catch
{
Write-Host -ForegroundColor Red "There was a problem saving your credentials"
Write-Host -ForegroundColor Red "There was a problem saving your credentials: $_"
}