Azure DevTest Labs任务(创建VM)丢失模板参数的引号 [英] Azure DevTest Labs Tasks (Create VM) losing quotes for template parameter

查看:54
本文介绍了Azure DevTest Labs任务(创建VM)丢失模板参数的引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下模板参数来创建VM

 

-Run_PowerShell_scriptFileUris'[" $(dtlContainerURI)/ bootstrap-dev- vm.ps1 $(dtlSasToken)"]'




关于首先评估我可以看到的参数

 

使用以下参数调用任务:

TemplateParameters = -Run_PowerShell_scriptFileUris'[" https://< account> .blob.core.windows.net /< container> /bootstrap-dev-vm.ps1?< token>"]'

然后,似乎我的单引号和双引号不再有效,因为它更改为 

 

使用以下参数调用部署:

TemplateParameters = -Run_PowerShell_scriptFileUris'['

解决方案

我们有使用  Azure CLI    ARM
模板
,我建议。 我相信这些方法中的任何一种都能为您提供所需的结果。



就PowerShell中的转义字符而言,请查看在我们的关于引用规则的
文档适用于PowerShell
。 双引号允许您替换变量并计算表达式,而单引号完全按照键入的方式传递命令。  PowerShell转义字符是反引号字符(`)
(ASCII 96)。



输入:




i
=
5
"
的值


i 是

I use the following template parameters to create a VM

-Run_PowerShell_scriptFileUris '["$(dtlContainerURI)/bootstrap-dev-vm.ps1$(dtlSasToken)"]'


On the first evaluation of the parameter I can see

Task called with the following parameters:

TemplateParameters = -Run_PowerShell_scriptFileUris '["https://<account>.blob.core.windows.net/<container>/bootstrap-dev-vm.ps1?<token>"]'

Then later, it seem my single and double quote no longer works as it changes to 

Invoking deployment with the following parameters:

TemplateParameters = -Run_PowerShell_scriptFileUris '['

解决方案

We have documentation for creating VMs in DevTest Labs using both the Azure CLI as well as an ARM template, which I would recommend.  I believe that either of these approaches would give you the results you are looking for.

As far as escaping characters in PowerShell is concerned, look at our documentation on quoting rules for PowerShell.  Double quotes allow you to substitute variables and evaluate expressions while single quotes pass the command exactly as it is typed.  The PowerShell escape character is the backtick character (`) (ASCII 96).

Input:


i = 5 "The value of


i is


这篇关于Azure DevTest Labs任务(创建VM)丢失模板参数的引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆