1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
bitwarden-server/dev/setup_secrets.ps1
2021-10-13 19:30:03 +02:00

22 lines
648 B
PowerShell

#!/usr/bin/env pwsh
# Helper script for applying the same user secrets to each project
param (
[bool]$clear,
[Parameter(ValueFromRemainingArguments = $true, Position=1)]
$cmdArgs
)
if (!(Test-Path "secrets.json")) {
Write-Warning "No secrets.json file found, please copy and modify the provided example";
exit;
}
$projects = "Admin", "Api", "Billing", "Events", "EventsProcessor", "Icons", "Identity", "Notifications";
foreach ($projects in $projects) {
if ($clear -eq $true) {
dotnet user-secrets clear -p "../src/$projects"
}
Get-Content secrets.json | & dotnet user-secrets set -p "../src/$projects"
}