小编inv*_*bl3的帖子

如何在powershell中创建多个文件夹

在 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)

powershell batch-file

15
推荐指数
2
解决办法
3万
查看次数

标签 统计

batch-file ×1

powershell ×1