Fix PSReviewUnusedParameter code scanning alerts (#2208)
Addresses open PSScriptAnalyzer code scanning alerts ## Approach The alerts fall into distinct categories, each handled differently: **Production code - true fixes:** - **`Build-AppsInWorkspace`**: Removed `MajorMinorVersion`, `BuildNumber`, and `RevisionNumber` parameters. These were accepted but never used - version stamping is handled by `Update-AppJsonProperties` which is called separately before compilation. Also removed the corresponding entries from the `\` splatting in `Compile.ps1`. - **`e2eTestHelper.psm1`**: The `\` parameter was accepted by `CreateNewAppInFolder` but never written into the generated `app.json`. Added `runtime` to the output - this is a bug fix. - **`CompileFromWorkspace.psm1`**: Replaced an empty catch block (for unparseable .NET runtime versions) with an `OutputDebug` call that logs the version string and error. **Production code - suppressed:** - **`Compile.ps1`**: `\` is passed by the action YAML workflow and cannot be removed without updating the action definition. It may also be needed for future incremental build support (see existing TODO). Added a targeted `SuppressMessageAttribute`. **Test files - fixed:** - **`AL-Go-Helper.Test.ps1`**: `\` was assigned in `BeforeEach` but PSScriptAnalyzer flagged it as unused since usage was in separate `It` blocks. Scoped it to `\` so the cross-block usage is explicit. **Test files - suppressed:** - **`CompileFromWorkspace.Test.ps1`** and **`DownloadProjectDependencies.Test.ps1`**: All 57 alerts are Pester mock scriptblock parameters that must match the mocked function's signature for positional binding. Added file-level `SuppressMessageAttribute` with justification. --------- Co-authored-by: aholstrup1 <aholstrup1@users.noreply.github.com>
A
Alexander Holstrup committed
4a049b1dee9c889d027278c87e7563f34a25b320
Parent: 73af601
Committed by GitHub <noreply@github.com>
on 4/10/2026, 12:17:06 PM