The following code will output the command string I wish to run:
[string] $SourceRepo="C:\inetpub\wwwroot\Spyda\"
[string] $Repo="C:\inetpub\wwwroot\BranchClone\"
[string] $revstring="--rev `"default`" --rev `"case 1234`""
Write-Output "hg clone $SourceRepo $Repo $revstring"
Which gives
hg clone C:\inetpub\wwwroot\Spyda\ C:\inetpub\wwwroot\BranchClone\ --rev "default" --rev "case 1234"
If I run that from a powershell prompt, it works, if I try to run the hg clone command from a script using this syntax, it fails:
hg clone $SourceRepo $Repo $revstring
Error given:
hg.exe : hg clone: option --rev default --rev case not recognized
At line:6 char:3
+ hg <<<< clone $SourceRepo $Repo $revstring
+ CategoryInfo : NotSpecified: (hg clone: optio... not recognized:String) [], RemoteE
xception
+ FullyQualifiedErrorId : NativeCommandError