【问题标题】:Setting up 1-click Install for custom Powershell provider为自定义 Powershell 提供程序设置一键安装
【发布时间】:2012-08-23 14:56:18
【问题描述】:

我创建了一个自定义 Powershell 提供程序。但是,目前人们必须执行几个步骤才能使其在用户的计算机上运行:

  1. 配置 Powershell 以针对 .Net 4 运行(在 c:\Windows\System32\WindowsPowerShell\v1.0 中添加配置文件)
  2. 添加自定义格式化程序(到 System32 for c:\Windows\System32\WindowsPowerShell\v1.0)。
  3. 注册管理单元。

其余设置步骤由自定义 powershell 脚本完成。

我想知道是否有人可以分享他们在简化流程方面的经验。理想情况下,我希望人们从单个命令运行(理想情况下是完成上述所有步骤的 CommandLet。

有没有人可以分享任何链接或建议或最佳实践?

【问题讨论】:

  • 我进行了编辑,以使其更清楚您的要求 - 本质上是部署 Powershell 扩展及其格式化程序等的最佳实践。对于我的两便士,我建议检查源代码现有的 Powershell 脚本,特别是 PSCX(社区扩展),它们已经很容易安装并带有预装的格式化程序。

标签: powershell provider snap-in pssnapin


【解决方案1】:

我发现了以下可能有帮助的 sn-ps。

VS 命令提示符变量

对于 Visual Studio 命令,您可以尝试 Lee Holmes 的 http://poshcode.org/2176 或 Powershell Communit 扩展 (PSCVX)。均来自https://superuser.com/questions/104868/run-visual-studio-command-line-tools-in-windows-powershell

之后它只是格式化程序和/或注册管理单元。

将 Powershell 配置为使用 .Net4

How can I run PowerShell with the .NET 4 runtime?

【讨论】:

    猜你喜欢
    • 2010-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-02
    • 2022-01-16
    • 1970-01-01
    相关资源
    最近更新 更多