Powershell 如何将多个参数传递给dotCover合并
我正在编写powershell命令以合并两个快照,如下所示-Powershell 如何将多个参数传递给dotCover合并,powershell,nunit,dotcover,Powershell,Nunit,Dotcover,我正在编写powershell命令以合并两个快照,如下所示- &$coveragTool merge /Source= $TestResult1;$TestResult2 /Output= TestMergeOutput.dcvr 它给出了错误的定义- Parameter 'Source' has invalid value. Invalid volume separator char ':' (0x3A) in path at index 67. 其中,如文档所述,两个文件应以分号
&$coveragTool merge /Source= $TestResult1;$TestResult2 /Output= TestMergeOutput.dcvr
它给出了错误的定义-
Parameter 'Source' has invalid value.
Invalid volume separator char ':' (0x3A) in path at index 67.
其中,如文档所述,两个文件应以分号(;)分隔
像这样-
merge: Merge several coverage snapshots
usage: dotCover merge|m <parameters>
Valid parameters:
--Source=ARG : (Required) List of snapshots separated with semicolon (;)
--Output=ARG : (Required) File name for the merged snapshot
--TempDir=ARG : (Optional) Directory for the auxiliary files. Set to system temp by default
Global parameters:
--LogFile=ARG : (Optional) Enables logging and allows specifying a log file name
--UseEnvVarsInPaths=ARG : (Optional) [True|False] Allows using environment variables (for example, %TEMP%) in paths. True
by default
merge:合并多个覆盖率快照
用法:dotCover merge | m
有效参数:
--Source=ARG:(必选)以分号(;)分隔的快照列表
--Output=ARG:(必选)合并快照的文件名
--TempDir=ARG:(可选)辅助文件的目录。默认设置为系统温度
全局参数:
--LogFile=ARG:(可选)启用日志记录并允许指定日志文件名
--UseEnvVarsInPaths=ARG:(可选)[True | False]允许在路径中使用环境变量(例如,%TEMP%)。真的
默认情况下
如何使其正确?您不能传递不带引号的
作为参数的一部分,因为PowerShell将其解释为语句分隔符
将参数括在“…”
,或`
-转义代码>字符选择;另外,=
后面的空格可能是问题,也可能不是问题
要使调用(至少在语法上)成功,请使用以下命令:
& $coveragTool merge /Source="$TestResult1;$TestResult2" /Output=TestMergeOutput.dcvr
或者(注意`
,忽略中断的语法突出显示):
PowerShell具有比cmd.exe
更多的所谓元字符,例如,特别是(),{};@$#代码>除了&
-有关更多信息,请参阅
& $coveragTool merge /Source=$TestResult1`;$TestResult2 /Output=TestMergeOutput.dcvr