我尝试通过PowerShell在单个ps1脚本中运行以下命令,希望两个本地服务器在不同的端口上打开 - 只打开8080:
cd "\\blah\Statistics\Reporting\D3\walkthroughs\letsMakeABarChart"
python -m http.server 8080
cd "\\foo\data_science\20161002a_d3js\examples"
python -m http.server 8000
我可以调整它以便打开吗?
答案 0 :(得分:1)
第一个python调用可能没有返回所以你可以使用Start-Job
cmdlet:
$job1 = start-job -scriptblock {
cd "\\blah\Statistics\Reporting\D3\walkthroughs\letsMakeABarChart"
python -m http.server 8080
}
$job2 = start-job -scriptblock {
cd "\\foo\data_science\20161002a_d3js\examples"
python -m http.server 8000
}
# Wait until both web servers terminates:
Wait-Job -Job ($job1, $job2)