PS C:\> powershell.exe ls -ErrorAction stop
找不到元素。
找不到元素。
目录: C:\
Mode LastWriteTime Length Name
—- ————- —— —-
d—- 2017/8/15 16:41 atm
d—- 2018/2/1 15:01 GitLab-Runner
d-r– 2018/2/3 9:55 Program Files
d—- 2018/2/2 15:16 Python27
d—- 2016/11/18 16:56 Sangfor-ATT
d—- 2018/2/2 15:13 soft
d—- 2018/2/2 8:53 test
d-r– 2016/2/17 9:35 Users
d—- 2017/5/15 11:50 Windows
-a— 2009/6/11 5:42 24 autoexec.bat
-a— 2009/6/11 5:42 10 config.sys
-a— 2018/2/2 9:45 41 hello.rb
-a— 2018/2/1 20:27 31 ls.txt
-a— 2018/2/5 15:41 79 show.bat
注: 该问题的原由是: gitlab-ci 跟windows runner结合,而runner只能用powershell, 单独执行命令失败后,ci上返回有误,非得调用powershell.exe ,所有,请各位同道帮忙瞅瞅