I am creating a .net Standard 2.0 NuGet package and I want to deploy a config file and mark this file as “Content” and “Copy if Newer”.When I install the package, the config file is deployed at the root of the project, but the properties are set to the default values: “None” and “Do Not Copy”.I tried to solve the problem with an inline powershell script in azure pipelines:
- powershell: | $project= Get-Project Foo $project.ProjectItems.Item("foo.config").Properties.Item("CopyToOutputDirectory").Value = 2 $project.ProjectItems.Item("foo.config").Properties.Item("BuildAction").Value = 2
but I got the following error:
Get-Project : The term 'Get-Project' is not recognized as the name ofa cmdlet, function, script file, or operable program...
Is there a way to set these properties in a pipeline task?