在 cmd 中可以使用如下命令mkdir /data/rs1 /data/rs2 /data/rs3
:
一切都是正确的:
但是如何在powershell中实现呢?
我正在尝试使用引号,例如:
使用引号,我只得到一个文件夹并且在 powershell 中遇到问题:
mkdir : Could not find part of the path "rs3".
??????:1 ????:1
+ mkdir "/data/rs1 /data/rs2 /data/rs3"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\data\rs1 \data\rs2 \data\rs3:String) [New-Item], DirectoryNotFoundException
+ FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Commands.NewItemCommand
Run Code Online (Sandbox Code Playgroud)
没有 qoutes 也是问题并且没有任何文件夹 :
mkdir : Can not find a positional parameter that takes an argument"/data/rs2".
??????:1 ????:1
+ mkdir /data/rs1 /data/rs2 /data/rs3
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [mkdir], ParameterBindingException
+ FullyQualifiedErrorId …
Run Code Online (Sandbox Code Playgroud)