【发布时间】:2017-01-07 01:36:23
【问题描述】:
我正在尝试引用与 powershell 脚本位于同一存储库中的文件的相对路径。
我有以下目录结构。
repo/
├── files
│ └── scripts.sh
│
├── powershell_scripts
└── my_powershell.ps1
在my_powershell.ps1 我想推荐scripts.sh。我尝试在 powershell 脚本中使用$PSScriptRoot,但它没有按我想要的方式工作。
我希望my_powershell.ps1 接收带有目录结构的scripts.sh。
有人知道这是怎么做的吗?
谢谢
【问题讨论】:
-
我看到您将 PSv2 列为标签。你真的要在版本 2 上运行它吗?
-
在 powershell-v3.0 上运行
标签: powershell automation powershell-3.0