考虑“outer.ps1”:
"in outer.ps1"
. .\inner.ps1
"in outer.ps1 after sourcing inner.ps1"
那个来源“inner.ps1”刚刚退出:
exit 0
当我运行“outer.ps1”时,输出表明退出仅从“inner.ps1”返回:
in outer.ps1
in outer.ps1 after sourcing inner.ps1
是否可以从 inner.ps1 退出 powershell 进程?我不想抛出异常,这将是一个正常的终止。