fix(Bump-Version): param() must be script's first statement

$ErrorActionPreference and Set-StrictMode sat before param(), so
PowerShell parsed 'param(...)' as a call to a command named param
instead of the script's parameter block ("The function or command
was called as if it were a method"). The script never ran. Moved
both statements after the param block; only #Requires and the
comment-based help may precede param().

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-29 11:49:21 +02:00
parent 65e451413e
commit ac3f30db1e
+4 -3
View File
@@ -8,13 +8,11 @@
################################################## ##################################################
## Project: Elysium ## ## Project: Elysium ##
## File: Bump-Version.ps1 ## ## File: Bump-Version.ps1 ##
## Version: 2.4.4 ## ## Version: 2.4.5 ##
## Support: support@cqre.net ## ## Support: support@cqre.net ##
################################################## ##################################################
#Requires -Version 5.1 #Requires -Version 5.1
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
<# <#
.SYNOPSIS .SYNOPSIS
@@ -41,6 +39,9 @@ param(
[switch]$SkipChangelog [switch]$SkipChangelog
) )
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
$scriptRoot = $PSScriptRoot $scriptRoot = $PSScriptRoot
if (-not $scriptRoot) { $scriptRoot = (Get-Location).Path } if (-not $scriptRoot) { $scriptRoot = (Get-Location).Path }