-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Problem
The organization
parameter is defined in the PowerShell script backup-repos.ps1
but is never used. The script relies on Azure CLI configuration instead.
Current State
- PowerShell Script: The
organization
parameter is defined but not used - run.sh: Sets the organization via
az devops configure --defaults organization=https://dev.azure.com/$AZURE_DEVOPS_EXT_ORG
- README.md: Documents the parameter, but it's misleading since it's not actually used
Possible Solutions
Option 1: Use the parameter
The PowerShell script should use the organization
parameter to set the Azure CLI configuration:
if ($organization) {
az devops configure --defaults organization=https://dev.azure.com/$organization
}
Option 2: Alternative approaches for setting organization
-
Azure CLI Configuration (currently used):
az devops configure --defaults organization=https://dev.azure.com/[ORG]
-
Environment Variable AZURE_DEVOPS_EXT_ORG (used in Docker container):
export AZURE_DEVOPS_EXT_ORG=contoso
-
Parameter with each az devops command:
az devops project list --organization https://dev.azure.com/[ORG]
Recommended Solution
- Use the
organization
parameter in the PowerShell script - Update README.md to document all available options
- Implement fallback logic: Parameter → Environment Variable → Configuration
Affected Files
backup-repos.ps1
: Use the parameterREADME.md
: Update documentationrun.sh
: Possibly adjust for consistent parameter passing
Additional Context
The current implementation causes confusion because:
- Users pass the
-organization
parameter but it has no effect - The actual organization is set via environment variable or CLI configuration
- Documentation doesn't reflect the actual behavior
Metadata
Metadata
Assignees
Labels
No labels