Porting my bat scripts to PowerShell. Two problems: $info
expands in strings like "$info"
; when running commands from a file somewhere spoil the arguments (in interactive mode appears only the first problem. the console output "hg tip: invalid arguments").
Command:
hg tip --template "<?php\r\n// ќв® ўв®¬ вЁзҐбЄЁ бЈҐҐаЁа®ў л© д ©« б Ёд®а¬ жЁҐ© ® ⥪г饬 ЎЁ«¤Ґ ¬®¤г«п\r\n$info = array(\r\n'rev' => '{rev}',\r\n'date' => '{date|isodate}',\r\n'changeset' => '{node}',\r\n);" > modules/video/version.php
Also, another way is to use single-quotes instead of double quotes you are using now.
update:
Ok, so basically you have 3 approaches.
Example for third approach:
[12:06:58 PM] ~> $str = @'
'$'`#'"<>\/@
'@
_______________________________________________________________________________________________________________________________________________________________________________________________
[12:07:15 PM] ~> $str
'$'`#'"<>\/@
to not evaluate $info
as variable you must write it as `$info
. Like:
hg tip --template "<?php\r\n// ќв® ўв®¬ вЁзҐбЄЁ бЈҐ®ў © д ©« б Ё®а¬ жЁҐ© ® ⥪г饬 ЎЁ«¤Ґ ¬®¤г«п\r\n`$info = array(\r\n'rev' => '{rev}',\r\n'date' => '{date|isodate}',\r\n'changeset' => '{node}',\r\n);" > modules/video/version.php
$ is powershell keyword therefore `$
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.