【发布时间】:2014-01-28 21:18:43
【问题描述】:
我在 ServerA 上有一个 powershell 脚本 (test.ps1)。所有脚本应该做的是检查服务器上是否存在文件夹。我正在从客户端(在同一网络内)执行脚本
test.ps1
test-path E:\automation
# returns whether this folder exists on ServerA
我正在从 ComputerB 的 powershell 调用该脚本。
PS > pushd \\serverA\scripts
PS > .\test.ps1
输出:
False
预期输出:
True
问题:
The script is trying to locate the folder on the "local system" (ComputerB) rather than ServerA
【问题讨论】:
标签: powershell directory remote-server