Not able to copy ps1 files to nuget package

29 views Asked by At

I have created a nuget package for a service. I need to add a few ps1 scripts inside this nuget package. I am trying to achieve the same using this:

<ItemGroup>    
<Content PackagePath="lib\net472\" Include="<packagepath>\net472\**" />
</ItemGroup>

In this, <packagepath>\net472 has variety of files and folders. It has ps1 scripts, dlls, exe files etc. This above line is only copying the dlls and exe files but not the ps1 scripts. If I try to copy using *.ps1 instead of ** then I see error saying that it should be in tools folder. If I create a tools folder and put in it, it says the scripts should be named install.ps1 or uninstall.ps1 or init.ps1 etc. But I have a bunch of ps1 files and I need to copy them as they are without changing the names. Note: This works in non-SDK style of coding but mine is a csproj with SDK style. I am new to .NET, c sharp and this entire ecosystem. Can someone please help me how to resolve this?

0

There are 0 answers