I am trying to edit the <Reference> XML node of the currently installing NuGet package library in the csproj via PowerShell to add a Condition="..." attribute.
I was able to call my PowerShell Install.ps1 script during the package's installation but the <Reference> node is not present at that moment.
If I manually add the desired Condition="..." attribute to the csproj it gets removed when updating the NuGet package.
Is there a way to automatically run a PowerShell script after NuGet adds the <Reference> node of the installed library? Or a way to somehow modify the node that NuGet adds when installing the package?