Equivalent for linux mkdir {fileA,fileB} in PowerShell

风流意气都作罢 提交于 2019-12-25 07:20:15

问题


I'm just curios. Is there an equivalent for PowerShell that behaves equally to the liunx command listed in the title, i.e.

mkdir {folderA, folderB}

?

-- edit

the command listed above creates the folders "folderA" and "folderB" (just saw that I wrote file previously. Sorry, my fault) in the current working directory.


回答1:


The mkdir command in PowerShell is a wrapper for the New-Item command. If you want to create multiple folders with a single command, then run:

mkdir c:\test,c:\test2;

Effectively, because of positional parameters in PowerShell, this passes the array c:\test,c:\test2 to the -Path parameter of the New-Item command.



来源:https://stackoverflow.com/questions/23737950/equivalent-for-linux-mkdir-filea-fileb-in-powershell

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!