From a46d08364ab3f7622e468ae49005c4eadc3c974a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Isaac=20Hern=C3=A1ndez=20Cruz?= <96310311+RisokHdz@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:59:18 -0600 Subject: [PATCH] Fixing Powershell Code Strings --- deployments/docker/generate_api_key.ps1 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/deployments/docker/generate_api_key.ps1 b/deployments/docker/generate_api_key.ps1 index 5e494f6..e63f678 100644 --- a/deployments/docker/generate_api_key.ps1 +++ b/deployments/docker/generate_api_key.ps1 @@ -1,8 +1,14 @@ Write-Host "Generating API key..." -# all characters -$API_KEY=(-join ((33..126) | Get-Random -Count 32 | % {[char]$_})) +# Define character ranges for alphanumeric characters +$chars = @() +$chars += 48..57 # 0-9 +$chars += 65..90 # A-Z +$chars += 97..122 # a-z + +# Generate API key +$API_KEY = -join ($chars | Get-Random -Count 64 | ForEach-Object { [char]$_ }) $env:AI_UNLIMITED_INIT_API_KEY = $API_KEY -Write-Host "API Key is generated, please export it by running the following command: \n" -Write-Host '$env:AI_UNLIMITED_INIT_API_KEY = $API_KEY' \ No newline at end of file +Write-Host "API Key is generated, please export it by running the following command: `n" +Write-Host '$env:AI_UNLIMITED_INIT_API_KEY = $API_KEY'