
我写了个 test.ps1 ,内容是
echo TEST 运行结果只有一个 TEST
请问如何让 echo TEST 同时显示出来?
1 Kasumi20 2022-08-25 10:59:08 +08:00 echo echo TEST |
3 h404bi 2022-08-25 11:28:52 +08:00 显示被执行的命令?开 Debug 模式呗,Set-PSDebug -Trace 1 https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-psdebug |
5 AoEiuV020CN 2022-08-25 12:17:33 +08:00 |
6 nuII 2022-08-25 13:29:31 +08:00 一般都是手动处理,比如把命令显示一遍,然后再执行一遍。 ``` $command = 'get-date' #一定要加引号,不然就是一个 cmdlet 命令,变量里就是结果而不是命令了 $command; powershell $command ``` |