Powershell 构建路径并使用参数调用python

Powershell 构建路径并使用参数调用python,powershell,powershell-3.0,Powershell,Powershell 3.0,我有一个运行良好的PowerShell脚本: ../third_party/python3/win_x86_64/python.exe fusion.py $args 现在很明显,只有当前工作目录正确时,这才有效。因此,我添加了一个变量$abs\u parent\u path 简单地在前面加上这句话是行不通的: $abs_parent_path/../third_party/python3/win_x86_64/python.exe fusion.py $args 似乎PowerShell的

我有一个运行良好的PowerShell脚本:

../third_party/python3/win_x86_64/python.exe fusion.py $args
现在很明显,只有当前工作目录正确时,这才有效。因此,我添加了一个变量
$abs\u parent\u path

简单地在前面加上这句话是行不通的:

$abs_parent_path/../third_party/python3/win_x86_64/python.exe fusion.py $args
似乎PowerShell的某些魔力正在崩溃


现在我的问题是如何构建Python和Invocate的绝对路径。

你能试试这个:
&(Join path$abs\u parent\u path”/../third\u party/python3/win\u x86\u 64/Python.exe)fusion.py$args
导致了
出乎意料的失败
。事实上我错过了
。现在它抱怨
$abs\u parent\u path
参数bindingValidationException
。python的可执行路径是众所周知的吗?为什么不能硬编码呢?示例路径说明它是相对于另一条路径的。而另一条路径在不同的系统之间是不同的。