Touch on windows


I am trying to run one simple pipeline job. Runner in windows 10. The command “touch” in .gitlab-ci.yml script fails with the following error:

touch : The term ‘touch’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check

27the spelling of the name, or if a path was included, verify that the path is correct and try again.

28At C:\WINDOWS\TEMP\build_script564174167\script.ps1:211 char:1

29+ touch info.txt

30+ ~~~~~

31 + CategoryInfo : ObjectNotFound: (touch:String) , CommandNotFoundException

32 + FullyQualifiedErrorId : CommandNotFoundException

My .yml snippet is:
- build
- test

stage: build
- echo “building…”
- mkdir build
- touch info.txt

Any help is highly appreciated.


Is this Powershell? I don’t use Windows much, but I suspect the command touch might not exist in Powershell. This SO answer might be of use to you.

1 Like

Yes Powershell. Yes seems touch not available in this shell. Thanks a lot.