2016-06-03 2 views
0

PowerShell의 환경 매개 변수를 배치 파일에 전달하려고합니다. 배치에 사용할 올바른 XML을 호출합니다.Powershell 매개 변수를 배치 파일에 전달하십시오.

PowerShell을 스크립트 :

$SelectedXMLServer = "$x.xml" 
Start-Process "C:\DeployTools\Latest_Deployment.bat" $SelectedXMLServer 

는 아직 배치 파일을 호출 만에 매개 변수를 전달하지 않습니다

배치 파일 :.

@echo off 
CD /D "C:\Deployment\Install\DeployScripts" 
echo Deployment will now start 
cscript deploy.vbs ..\DeploymentXml\%Deploymentxml%.xml 
+0

'Start-Process -FilePath "C : \ DeployTools \ Latest_Deployment.bat"-ArgumentList "$ SelectedXMLServer"'시도하십시오. – Martin

답변

0

단순히 배치 파일을 변경하는 경우 1로 작동 됨

@echo off 
CD /D "C:\Deployment\Install\DeployScripts" 
echo Deployment will now start 
cscript deploy.vbs ..\DeploymentXml\%l%.xml 
관련 문제