powershell - 批处理文件在执行下一个命令之前等待powershell行解压缩?
问题描述
基本上我有一个批处理文件,它使用单行 powershell 命令解压缩文件,但它不会等待该 powershell 命令完成执行。Call
不工作,start /w
不工作,start powershell [cmd] -Wait
不工作 我该怎么办?
cd..
start powershell Expand-Archive update.zip -DestinationPath %appdata%\ModManager\ > nul
cd %appdata%\ModManager\
[other code...]
解决方案
只是不要使用“开始”。直接运行powershell。您还需要在批处理文件中修复一些问题。用这个命令代替第二行:
powershell -executionpolicy unrestricted -command "Expand-Archive update.zip -DestinationPath $env:APPDATA\ModManager\ | out-null"
推荐阅读
- javascript - ExcelJS中实际值为0(零)时如何在单元格中显示'-'字符
- javascript - 如何从字符串中提取最大的数字?
- android - 如何修复 JobScheduler(不是调度任务)
- python - 从 df 动态更新 Dash 数据表
- python - Azure App Services:停止站点 MYSITE,因为它在启动期间失败
- c# - 无法打开登录请求的数据库用户 C# 的登录失败
- java - Java Socket 数据包拦截
- python - Python Pandas:为 2 个分类变量的唯一组合创建变量?
- flutter - ItemList 中的 ItemList 不滚动
- reactjs - AWS Amplify Storage.get 函数中的 useEffect 内存泄漏