【发布时间】:2015-01-10 20:23:16
【问题描述】:
我有一个引用了许多 PS1 文件的 Power Shell 模块。
. $PSScriptRoot\vs-command.ps1
. $PSScriptRoot\open.ps1
. $PSScriptRoot\git.ps1
. $PSScriptRoot\build.ps1
. $PSScriptRoot\deploy.ps1
. $PSScriptRoot\count.ps1
. $PSScriptRoot\tab.ps1
. $PSScriptRoot\test.ps1
. $PSScriptRoot\nuget.ps1
. $PSScriptRoot\checkforxml.ps1
此 PSM1 文件保存在 Documents\WindowsPowerShell\Modules 的位置,目前与上面引用的 PS1 文件相关联。
上面的文件对 Visual Studio 项目\解决方案执行了许多操作,我现在要求将每个文件保存在解决方案文件夹中自己的文件夹中。
我需要找到一种在打开同一个 PowerShell 窗口时切换 $PSScriptRoot 的方法。
所以......要求是......这些文件的初始加载,所以我有我期望的基本命令......然后......当我切换到保存在 d:\slns 中的解决方案文件夹时将检测到根目录已更改,然后拾取新的 ps1 文件。 .
我对 powershell 非常陌生,因此非常感谢所有帮助和信息。
谢谢
【问题讨论】:
标签: powershell