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)