[英]Problem running a powershell command containing path with spaces inside multiple nested quotes using node.js
[英]nested mkdir inside directory with spaces
這個命令:
mkdir "watermelon fun"\example
輸出以下內容:
PS C:\Users\Andrés\temp> mkdir "watermelon fun"\example
mkdir : No se encuentra ningún parámetro de posición que acepte el argumento '\example'.
En línea: 1 Carácter: 1
+ mkdir "watermelon fun"\example
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [mkdir], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,mkdir
有沒有辦法可以創建一個嵌套目錄,這是一個多字目錄?
你必須用引號括起完整的路徑:
mkdir "watermelon fun\example"
請考慮使用Join-Path cmdlet組合路徑。
$path = join-path 'watermelon fun' 'example'
New-Item -Path $path -ItemType Directory -Force
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.