githubschool / Sept-5

Let's learn about Git and GitHub
https://githubschool.github.io/Sept-5/
MIT License
1 stars 0 forks source link

touch in PowerShell script #27

Open rmpolak opened 5 years ago

rmpolak commented 5 years ago

This script: https://githubtraining.github.io/training-manual/#/18_create_local_repo?id=powershell uses the touch command which PowerShell doesn't recognise.


for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git commit -m "adding file$d.md"; }
>>
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:30
+ for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git  ...
+                              ~~~~~
    + CategoryInfo          : ObjectNotFound: (touch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

fatal: pathspec 'file1.md' did not match any files
On branch master
nothing to commit, working tree clean
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:30
+ for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git  ...
+                              ~~~~~
    + CategoryInfo          : ObjectNotFound: (touch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

fatal: pathspec 'file2.md' did not match any files
On branch master
nothing to commit, working tree clean
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:30
+ for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git  ...
+                              ~~~~~
    + CategoryInfo          : ObjectNotFound: (touch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

fatal: pathspec 'file3.md' did not match any files
On branch master
nothing to commit, working tree clean
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:30
+ for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git  ...
+                              ~~~~~
    + CategoryInfo          : ObjectNotFound: (touch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

fatal: pathspec 'file4.md' did not match any files
On branch master
nothing to commit, working tree clean
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:30
+ for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git  ...
+                              ~~~~~
    + CategoryInfo          : ObjectNotFound: (touch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

fatal: pathspec 'file5.md' did not match any files
On branch master
nothing to commit, working tree clean
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:30
+ for ($d=1; $d -le 6; $d++) { touch file$d.md; git add file$d.md; git  ...
+                              ~~~~~
    + CategoryInfo          : ObjectNotFound: (touch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

fatal: pathspec 'file6.md' did not match any files
On branch master
nothing to commit, working tree clean
githubteacher commented 5 years ago

@rmpolak could you please try this new syntax and let know if it works? 😄

for ($d=1; $d -le 6; $d++) { $null > file$d.md; git add file$d.md; git commit -m "adding file$d.md"; }

githubteacher commented 5 years ago

I've just verified and the above command works. We will update the manual with the new command and. Please proceed to close this issue once you have verified it at your machine 👍

powershellscript