From 50f828b5b0c62c25f13bf3f848c5d5e98bc22eaf Mon Sep 17 00:00:00 2001 From: Jonathan Horvath Date: Mon, 15 Sep 2025 18:11:26 -0400 Subject: [PATCH] Fix Join-Path parameter syntax errors in PowerShell scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move Join-Path calls from parameter defaults to script body - Resolves Azure DevOps pipeline error with parameter parsing - Maintains backward compatibility with existing script usage - All three version management scripts now work properly in CI environment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- scripts/Get-Version.ps1 | 9 +++++++-- scripts/Increment-Version.ps1 | 9 +++++++-- scripts/Set-Version.ps1 | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/scripts/Get-Version.ps1 b/scripts/Get-Version.ps1 index ab2abcfb..0bf5f75c 100644 --- a/scripts/Get-Version.ps1 +++ b/scripts/Get-Version.ps1 @@ -17,13 +17,18 @@ param( [Parameter(Mandatory = $false)] - [string]$BuildPropsPath = (Join-Path $PSScriptRoot ".." "Directory.Build.props"), - + [string]$BuildPropsPath, + [Parameter(Mandatory = $false)] [ValidateSet("Simple", "Detailed")] [string]$Format = "Detailed" ) +# Set default path if not provided +if (-not $BuildPropsPath) { + $BuildPropsPath = Join-Path $PSScriptRoot ".." "Directory.Build.props" +} + function Get-Version { param([string]$FilePath) diff --git a/scripts/Increment-Version.ps1 b/scripts/Increment-Version.ps1 index d65ebcf9..63f2a5a9 100644 --- a/scripts/Increment-Version.ps1 +++ b/scripts/Increment-Version.ps1 @@ -21,11 +21,16 @@ param( [Parameter(Mandatory = $false)] [ValidateSet("Major", "Minor", "Patch")] [string]$IncrementType = "Patch", - + [Parameter(Mandatory = $false)] - [string]$BuildPropsPath = (Join-Path $PSScriptRoot ".." "Directory.Build.props") + [string]$BuildPropsPath ) +# Set default path if not provided +if (-not $BuildPropsPath) { + $BuildPropsPath = Join-Path $PSScriptRoot ".." "Directory.Build.props" +} + function Get-CurrentVersion { param([string]$FilePath) diff --git a/scripts/Set-Version.ps1 b/scripts/Set-Version.ps1 index c6334b98..f1f451a8 100644 --- a/scripts/Set-Version.ps1 +++ b/scripts/Set-Version.ps1 @@ -18,11 +18,16 @@ param( [Parameter(Mandatory = $true)] [string]$Version, - + [Parameter(Mandatory = $false)] - [string]$BuildPropsPath = (Join-Path $PSScriptRoot ".." "Directory.Build.props") + [string]$BuildPropsPath ) +# Set default path if not provided +if (-not $BuildPropsPath) { + $BuildPropsPath = Join-Path $PSScriptRoot ".." "Directory.Build.props" +} + function Validate-Version { param([string]$Version)