Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将参数传递给Powershell_Powershell_Biztalk_Biztalk Deployment_Btdf - Fatal编程技术网

将参数传递给Powershell

将参数传递给Powershell,powershell,biztalk,biztalk-deployment,btdf,Powershell,Biztalk,Biztalk Deployment,Btdf,我有以下PS脚本: function Install-BizTalkApplication { param( [Parameter(Position=0,Mandatory=$true,HelpMessage="Msi file should be existing")] [ValidateScript({Test-Path $_})] [Alias("msi")] [string]$MsiFile, [Parameter(Position=1,HelpMessage="

我有以下PS脚本:

function Install-BizTalkApplication
{
 param(
  [Parameter(Position=0,Mandatory=$true,HelpMessage="Msi file should be existing")]
  [ValidateScript({Test-Path $_})]
  [Alias("msi")]
  [string]$MsiFile,

  [Parameter(Position=1,HelpMessage="Path wherein the resource file will be installed")]
  [Alias("path")]
  [string]$ApplicationInstallPath,

  [Parameter(Position=2,Mandatory=$true,HelpMessage="Only valid parameters are Local,Dev,Test and Prod")]
  [Alias("env")]
  [ValidateSet("Local","Dev","Prod","Test")]
  [string]$Environment,

[bool]$BTDeployMgmtDB=$true,
  [bool]$SkipUndeploy=$true
  )
我尝试使用Powershell ISE运行脚本,传递3个参数,如下所示:

BTDF\Sources\Deployment\BuildAndDeploy.ps1 -msi "C:\Builds\1\CIDemo2\CIDemo2 BTDF\Sources\Deployment\bin\Debug\CIDemo-1.0.0.msi" -ApplicationInstallPath "c:\program files (x86)\CIDemo" -Environment "Dev"
但我得到了以下错误:

The string starting:
At line:1 char:1
+  <<<< 'C:\Builds\1\CIDemo2\CIDemo2 BTDF\Sources\Deployment\BuildAndDeploy.ps1 -msi "C:\Builds\1\CIDemo2\CIDemo2 BTDF\Sources\Deployment\bin\Debug\CIDemo-1.0.0.msi" -ApplicationInstallPath "c:\program files
 (x86)\CIDemo" -Environment "Dev"
is missing the terminator: '.
At line:1 char:233
开始的字符串:
第1行字符:1

+路径中有一个空格-
C:\Builds\1\CIDemo2\CIDemo2 BTDF\Sources\Deployment\BuildAndDeploy.ps1

你必须引用它

按如下方式运行:

& 'C:\Builds\1\CIDemo2\CIDemo2 BTDF\Sources\Deployment\BuildAndDeploy.ps1' -msi "C:\Builds\1\CIDemo2\CIDemo2 BTDF\Sources\Deployment\bin\Debug\CIDemo-1.0.0.msi" -ApplicationInstallPath "c:\program files (x86)\CIDemo" -Environment "Dev"

我怀疑您达到了命令提示字符串长度限制。大概是255个字符。