Skip to content

Commit 464fbbd

Browse files
fix: use named parameters for Join-Path (PSAvoidUsingPositionalParameters)
1 parent 042f31e commit 464fbbd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/publish.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ LogGroup 'Load inputs' {
4343
# the artifact (workspace-root-relative), regardless of WorkingDirectory.
4444
$modulePathInput = $env:PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath
4545
$modulePathCandidate = if ([System.IO.Path]::IsPathRooted($modulePathInput)) {
46-
Join-Path $modulePathInput $name
46+
Join-Path -Path $modulePathInput -ChildPath $name
4747
} else {
48-
Join-Path $env:GITHUB_WORKSPACE $modulePathInput $name
48+
Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath $modulePathInput -AdditionalChildPath $name
4949
}
5050
if (-not (Test-Path -Path $modulePathCandidate)) {
5151
Write-Error ("Module directory not found at [$modulePathCandidate]. " +
@@ -83,7 +83,7 @@ LogGroup 'Load PR information' {
8383
# to preserve artifact integrity (the tested artifact is identical to the published artifact).
8484
LogGroup 'Resolve version from manifest' {
8585
Add-PSModulePath -Path (Split-Path -Path $modulePath -Parent)
86-
$manifestFilePath = Join-Path $modulePath "$name.psd1"
86+
$manifestFilePath = Join-Path -Path $modulePath -ChildPath "$name.psd1"
8787
Write-Host "Module manifest file path: [$manifestFilePath]"
8888
if (-not (Test-Path -Path $manifestFilePath)) {
8989
Write-Error "Module manifest file not found at [$manifestFilePath]"
@@ -244,7 +244,7 @@ LogGroup 'Create GitHub release' {
244244
# Attach the built module as a release artifact so consumers can download the exact
245245
# bytes that were tested and published to the PowerShell Gallery.
246246
$zipFileName = "$name-$publishPSVersion.zip"
247-
$zipPath = Join-Path ([System.IO.Path]::GetTempPath()) $zipFileName
247+
$zipPath = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath $zipFileName
248248
if (Test-Path -Path $zipPath) {
249249
Remove-Item -Path $zipPath -Force
250250
}

0 commit comments

Comments
 (0)