From 183f4deff8216ff9ecff3164c07bf23aad17c059 Mon Sep 17 00:00:00 2001 From: Dan Gough Date: Fri, 20 Dec 2024 11:27:19 +0000 Subject: [PATCH] Allow passing through of unbound positional parameters as-is --- .../PSScriptAnalyzer/Measure-ADTCompatibility.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PSAppDeployToolkit.Tools/PSScriptAnalyzer/Measure-ADTCompatibility.psm1 b/src/PSAppDeployToolkit.Tools/PSScriptAnalyzer/Measure-ADTCompatibility.psm1 index 1b63e34..c50c712 100644 --- a/src/PSAppDeployToolkit.Tools/PSScriptAnalyzer/Measure-ADTCompatibility.psm1 +++ b/src/PSAppDeployToolkit.Tools/PSScriptAnalyzer/Measure-ADTCompatibility.psm1 @@ -2731,6 +2731,11 @@ function Measure-ADTCompatibility # This is a splatted parameter, e.g. @params, retain the original value $NewParam = $boundParameter.Value.Value.Extent.Text } + elseif ($boundParameter.Key -match '^\d+$') + { + # This is an unrecognized positional parameter, pass through as-is + $newParam = $boundParameter.Value.Value.Extent.Text + } else { # This is a regular parameter, e.g. -Path 'xxx'