공백이 포함 된 레이블을 사용하여 srcSafe에서 "get"을 수행 할 때 powershell을 사용하려고합니다.powershell을 사용하여 소스 세이프티 라벨을 얻는 데 문제가 있습니다.
나는 exams의 params 승/공백을 전달하는 방법에 대한 수많은 게시물처럼 보이지만 작동을 시도한 것은 아무것도 없다. 내 문제가 라벨을 올바르게 공급하는 것 같습니다.
다음은 cmd 라인 버전 (작동)입니다.
ss get $/sandbox/TestSSCmdLine/* -R -I-N -VL"label space"
내 간단한 파워 쉘 버전입니다 : 내가 PowerShell을 cmd를 실행하면
ss get '$/sandbox/TestSSCmdLine/*' -R -I-N '-VL\"label space\"'
나는 어떤 파일을 얻을와 $ lastexitcode은 "100"입니다.
에코 인자는 내가 옳다고 생각하는 것을 보여줍니다.
Arg 0 is <get>
Arg 1 is <$/sandbox/TestSSCmdLine/*>
Arg 2 is <-R>
Arg 3 is <-I-N>
Arg 4 is <-VL"label space">
Powershell ISE도 동일하게 표시됩니다. 의 Arg 4 < -VLlabel 공간 :
DEBUG: NativeCommandParameterBinder Information: 0 : WriteLine Raw argument string: get $/sandbox/TestSSCmdLine/* -R -I-N "-VL\"label space\""
DEBUG: NativeCommandParameterBinder Information: 0 : WriteLine Argument 0: get
DEBUG: NativeCommandParameterBinder Information: 0 : WriteLine Argument 1: $/sandbox/TestSSCmdLine/*
DEBUG: NativeCommandParameterBinder Information: 0 : WriteLine Argument 2: -R
DEBUG: NativeCommandParameterBinder Information: 0 : WriteLine Argument 3: -I-N
DEBUG: NativeCommandParameterBinder Information: 0 : WriteLine Argument 4: -VL"label space"
그냥 작동하는 것 같다 과정은-시작 일을 혼동 :
$cmd = "ss.exe"
$args = "get", '$/sandbox/TestSSCmdLine/*', "-R", "-I-N", '-VL"label space"'
$proc = start-process $cmd $args -Wait -NoNewWindow -PassThru -WorkingDir $pwd
$proc.ExitCode
추가 혼란 항목은 사실 지금 에코 인수와 같이 버전 매개 변수를 보여줍니다 > -> 공백이 없으며 cmd 행에서도 작동하지 않습니다.
도움이 필요하시면 고맙습니다.
존 A.이 cmd
에서
시작 프로세스를 사용하면 \를 이스케이프 처리하지 않고 정상적으로 작동합니다.'ss get '$/sandbox/TestSSCmdLine/*'-R -IN ' -VL "label space" '? – BartekB
다음을 시도해보십시오. ss.exe'$/sandbox/TestSSCmdLine/* ''-R ''-IN "-VL"label space " ' ss가 실패하고 "공간이 기존 파일 이름이나 프로젝트가 아닙니다." echoargs는 다음을 나타냅니다. Arg 5는 <-VLlabel> Arg 6은입니다. –