简体   繁体   English

VS2015:设置Powershell模块解决方案的最佳方法是什么?

[英]VS2015: What is the best way to setup a Powershell module solution?

What I have: 我有的:

  • vs2015 vs2015
  • several class library projects in my solution 我的解决方案中的几个类库项目
  • module manifest(psd1) and scripts(ps1) that I don't know where to put yet 模块清单(psd1)和脚本(ps1),我不知道放在哪里

What I need: 我需要的:

  • After build I need to have a folder(MyModule) with the class libraries and some static files: powershell module manifest(psd1) and scripts(ps1) 构建之后,我需要一个带有类库和一些静态文件的文件夹(MyModule):powershell模块清单(psd1)和脚本(ps1)
  • I don't want to set a postbuild for the class libraries since their project purpose is to create an assembly 我不想为类库设置postbuild,因为他们的项目目的是创建一个程序集
  • The best solution for me will be to have some kind of project that depends on the CL projects and outputs a folder with the static files and CL DLLs. 对我来说最好的解决方案是拥有某种依赖于CL项目的项目,并输出一个包含静态文件和CL DLL的文件夹。

Note: PowerShell module project in VS2015 would be perfect for me if it had "Postbuild" capabilities. 注意: VS2015中的PowerShell模块项目如果具有“Postbuild”功能,对我来说将是完美的。 Unfortunately it has not. 不幸的是它没有。

I would use a Makefile project (New \\ Project \\ Templates \\ Visual C++ \\ General \\ Makefile Project). 我将使用Makefile项目(New \\ Project \\ Templates \\ Visual C ++ \\ General \\ Makefile Project)。 Go to its Properties \\ NMake tab and compose "Build Command Line" and other commands, as required. 转到其Properties \\ NMake选项卡,根据需要编写“Build Command Line”和其他命令。 In your case, the build command should copy needed files to the target location. 在您的情况下,构建命令应将所需文件复制到目标位置。 Do not be confused by names "Visual C++" and "NMake". 不要被名称“Visual C ++”和“NMake”混淆。 You can use any commands you want. 您可以使用任何所需的命令。

Finally, in a solution configure project dependencies or build order with this new project included. 最后,在解决方案中配置包含此新项目的项目依赖项或构建顺序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VS2015中的Service Fabric,PowerShell脚本执行失败 - Service Fabric in VS2015, PowerShell script failed to execute 在VS2015中调试Powershell无法可视化XML对象 - Debugging Powershell in VS2015 Can't Visualize XML objects 未找到请求值'VS2015'。 - Azure powershell - Requested value 'VS2015' was not found. - Azure powershell 为什么VS2015中的TestExplorer无法加载Pester模块? - Why TestExplorer in VS2015 failed to load Pester module? 如何在不使用VS扩展的情况下将EnvDTE用作VS2015项目/解决方案的一部分以更改其自身的设置? - How can I use EnvDTE as a part of a VS2015 project/solution in order to change its own settings without using VS extensions? 在VS2015中获取Nuget软件包的许可证 - Get licenses for the Nuget Packages in VS2015 对PowerShell的x64与x86可变性进行编程的最佳方法是什么? - What is the best way to program against powershell's x64 vs. x86 variability 实现PowerShell脚本翻译的最佳方法是什么? - What is the best way to implement translation for a PowerShell script? PowerShell解析这些字符串的最佳方法是什么? - What's the best way in PowerShell to parse these strings? 在 ASP.NET 5/VS2015 中遇到 DNX 参考问题 - Stuck with DNX reference issue in ASP.NET 5/VS2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM