Version
4.0.6280
Description
If customers want to bring their own PowerShell modules, we idicate they can save them to the Modules folder and they will be included in the build package if they are uploaded to github. In our current .gitignore, we specify bin so that we don't pick up generated files but PowerShell modules can include bin folders like in https://www.powershellgallery.com/packages/Az.Storage/8.1.0 (if you expand the file list you will see the file Storage.Autorest\bin\Az.Storage.private.dll).
This will result in the bin folder and its contents not making it to github and will eventually fail when that file is attempted to be loaded at runtime.
I believe the .gitignore used is https://github.com/Azure/azure-functions-core-tools/blob/main/src/Azure.Functions.Cli/StaticResources/gitignore
A possible fix is to exclude all files in bin folders except for the Modules folder.
**/bin/**
!Modules/**
Steps to reproduce
Create a PowerShell function app with PowerShell modules.
- pwsh
- git init
- func new
- mkdir Modules
- Save-Module az.storage -Path Modules
Expand the git changes and Modules/Az.Storage/8.1.0/Storage.Autorest/bin will be excluded from source control.