我正在尝试执行下面的脚本块。这在Win 7上工作正常但在W2K3上永远不会成功。工作处于永久运行状态。知道为什么吗?
$Scriptblock = {
Add-Content c:\temp\test.txt -Value "Starting..."
$processes = c:\temp\test.ps1
Add-Content c:\temp\test.txt -Value $processes
Add-Content c:\temp\test.txt -Value "finished"
}
If (-not(Test-Path "c:\temp\test.ps1")){Add-Content c:\temp\test.ps1 -Value "get-process"}
Start-Job -ScriptBlock $Scriptblock