From d4f76fb1328009ac9fcf1f01ad3e2f2c2aba65c4 Mon Sep 17 00:00:00 2001 From: Julian Lechner Date: Mon, 23 Nov 2026 09:15:17 +0100 Subject: [PATCH] fix(credentials): prompt for client when -Client is omitted add-credentials.ps1 and remove-credentials.ps1 saved $Client and $Key before dot-sourcing with-credential.ps1 and assigned them back afterwards. Without -Client, that assignment put an empty string into a ValidateSet variable, and the script stopped with ValidateSetFailure before it could ask which client to use. with-credential.ps1 now uses its own variable names, so the save-and-restore is no longer needed. Co-Authored-By: Claude Opus 5.5 --- scripts/commands/add-credentials.ps1 | 4 ---- scripts/commands/remove-credentials.ps1 | 4 ---- 2 files changed, 8 deletions(-) diff --git a/scripts/commands/add-credentials.ps1 b/scripts/commands/add-credentials.ps1 index a785a2f..b5bab6d 100644 --- a/scripts/commands/add-credentials.ps1 +++ b/scripts/commands/add-credentials.ps1 @@ -8,11 +8,7 @@ param( $ErrorActionPreference = 'Stop' $root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent . (Join-Path $root 'scripts/lib/install-targets.ps1') -$selectedClient = $Client -$selectedKey = $Key . (Join-Path $root 'scripts/lib/with-credential.ps1') -$Client = $selectedClient -$Key = $selectedKey if (-not $Client) { $Client = Read-InstallClient -Client $Client } if (-not $Key) { $Key = Read-Host 'Credential key' } diff --git a/scripts/commands/remove-credentials.ps1 b/scripts/commands/remove-credentials.ps1 index 48f27de..d7a0ec2 100644 --- a/scripts/commands/remove-credentials.ps1 +++ b/scripts/commands/remove-credentials.ps1 @@ -6,11 +6,7 @@ param( $ErrorActionPreference = 'Stop' $root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent . (Join-Path $root 'scripts/lib/install-targets.ps1') -$selectedClient = $Client -$selectedKey = $Key . (Join-Path $root 'scripts/lib/with-credential.ps1') -$Client = $selectedClient -$Key = $selectedKey if (-not $Client) { $Client = Read-InstallClient -Client $Client } if (-not $Key) { $Key = Read-Host 'Credential key to remove' }