已经有问题解决我的问题(我可以让&&在Powershell中工作吗?),但有一点不同.我需要两个命令的OUTPUT.看,如果我只是运行:
(command1 -arg1 -arg2) -and (command2 -arg1)
Run Code Online (Sandbox Code Playgroud)
我不会看到任何输出,而是stderr消息.正如所料,只需输入:
command1 -arg1 -arg2 -and command2 -arg1
Run Code Online (Sandbox Code Playgroud)
给出语法错误.
在Bash中,我可以轻松地做类似的事情
command1 && command2 || command3
Run Code Online (Sandbox Code Playgroud)
这意味着运行command1,如果command1成功运行command2,并且command1无法运行command3.
什么是PowerShell中的等价物?
在我的 React 项目上安装Webpack的过程中,遇到以下问题阻碍了我的进度:
配置 Webpack 的最后一步
npm run build && node ./dist/main.js
Run Code Online (Sandbox Code Playgroud)
Windows Power Shell / Visual Studio Code 上的错误
PS C:\Users\pythonbuddha\Desktop\to_experiment\to-do-list> npm run build && node ./dist/main.js
At line:1 char:15
+ npm run build && node ./dist/main.js
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
Run Code Online (Sandbox Code Playgroud)
承诺配置 webpack 的教程
https://developerhandbook.com/webpack/webpack-4-from-absolute-scratch/
https://developerhandbook.com/webpack/how-to-configure-scss-modules-for-webpack/
Run Code Online (Sandbox Code Playgroud)