Visual studio 在powershell脚本中设置自定义工具属性

Visual studio 在powershell脚本中设置自定义工具属性,visual-studio,powershell,Visual Studio,Powershell,我有一个NuGet包,其中有一个powershell脚本,每次安装包时都会自动执行。在包中,添加了一个.resx文件。在powershell脚本中,我希望将.resx文件的自定义工具属性设置为ResXFileCodeGenerator,以便自动创建设计器文件。我如何以最佳方式实现这一点 好吧,我让它工作了 显然,我只需要资源文件的projectitem,然后设置如下属性: $projectItemImages.Properties.Item("CustomTool").Value = $cust

我有一个NuGet包,其中有一个powershell脚本,每次安装包时都会自动执行。在包中,添加了一个.resx文件。在powershell脚本中,我希望将.resx文件的自定义工具属性设置为
ResXFileCodeGenerator
,以便自动创建设计器文件。我如何以最佳方式实现这一点

好吧,我让它工作了

显然,我只需要资源文件的projectitem,然后设置如下属性:

$projectItemImages.Properties.Item("CustomTool").Value = $customToolSetting;
$projectItemImages.Object.RunCustomTool();
$projectItemImages是.resx文件的projectItem对象

$customToolSetting是我要将其设置为的值,即
ResXFileCodeGenerator

之后,我只需像这样运行自定义工具:

$projectItemImages.Properties.Item("CustomTool").Value = $customToolSetting;
$projectItemImages.Object.RunCustomTool();

我不确定我是否理解你在这里想要实现的目标?你能给我们更多关于你的情况的信息吗?您的包的目标是packages.config world还是package reference/project json?