diff --git a/publish-scripts/chocolatey/installps_template b/publish-scripts/chocolatey/installps_template index fe7458aea..0f349d879 100644 --- a/publish-scripts/chocolatey/installps_template +++ b/publish-scripts/chocolatey/installps_template @@ -40,11 +40,12 @@ $packageArgs = @{ Install-ChocolateyZipPackage @packageArgs # only symlink for func.exe -$files = Get-ChildItem $toolsDir -include *.exe +$files = Get-ChildItem $toolsDir -filter *.exe -Recurse -File foreach ($file in $files) { - if (!$file.Name.Equals("func.exe")) { + if (!$file.Name.Equals("func.exe") -or (!($file.DirectoryName -eq $toolsDir) -and $file.Name.Equals("func.exe"))) { #generate an ignore file - New-Item "$file.ignore" -type file -force | Out-Null + $ignoreFilePath = Join-Path -Path $file.DirectoryName -ChildPath "$($file.Name).ignore" + New-Item -Path $ignoreFilePath -Type File -Force | Out-Null } }