0
我有我的.ps1
在同一文件夹中如何加载PowerShell脚本,这是在不同的目录下,同时执行测试用例
一般我们用它来保存在directory1
和MT .tests.ps1
在directory2
写剧本时,测试文件和脚本文件都在同一个文件夹
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
. "$here\$sut"
,但我有他们不同的文件夹中,如下所示,这样我怎么能工作正常加载路径,这样脚本文件应该得到加载