触摸命令在 VSC 终端中不起作用 [英] Touch command not working in Terminal of VSC

查看:64
本文介绍了触摸命令在 VSC 终端中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,仍在努力弄清楚如何配置我的开发环境.在 Visual Studio Code 中使用 touch 命令时出现错误.我可以使用 mkdir 创建目录,但无法创建 .php 文件.这是我得到的错误.有任何想法吗?谢谢!

I'm new and still trying to figure out how to configure my development environment. I'm getting an error when using the touch command in Visual Studio Code. I can use mkdir to create a directory, but can't create a .php file. Here's the error I'm getting. Any ideas? Thank you!

touch :术语touch"未被识别为 cmdlet、函数、脚本文件或可运行的程序.检查名称的拼写,或者如果包含路径,请验证路径是正确的,然后再试一次.在行:1 字符:1+ 触摸 new.php+ ~~~~~+ CategoryInfo : ObjectNotFound: (touch:String) [], CommandNotFoundException+ FullQualifiedErrorId : CommandNotFoundException

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:1 + touch new.php + ~~~~~ + CategoryInfo : ObjectNotFound: (touch:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

推荐答案

要在 PowerShell 中创建一个新的空文件,您可以使用:

To create a new empty file in PowerShell, you can use:

ni new.php

或者,没有别名和默认值:

or, without aliases and defaults:

New-Item -Path X:\path -Name new.php -ItemType File  

有关详细信息,请参阅Get-Help New-Item 或查看在线

For details see Get-Help New-Item or view online

这篇关于触摸命令在 VSC 终端中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆