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”;是否通过azure CLI为azure devtest lab VM提供支持?_Azure_Powershell_Artifacts_Azure Devtest Labs - Fatal编程技术网

“如何应用工件”;“运行PowerShell”;是否通过azure CLI为azure devtest lab VM提供支持?

“如何应用工件”;“运行PowerShell”;是否通过azure CLI为azure devtest lab VM提供支持?,azure,powershell,artifacts,azure-devtest-labs,Azure,Powershell,Artifacts,Azure Devtest Labs,我有一个PowerShell脚本,希望使用az lab vm-apply工件将工件添加到vm。谁能给我一个示例工件Json文件,以及如何从Azure CLI调用它? 非常感谢 给我一个示例工件Json文件,以及如何从Azure CLI调用它 以下示例显示了构成定义文件基本结构的部分: { "$schema": "https://raw.githubusercontent.com/Azure/azure-devtestlab/master/schemas/2016-11-28/dtlArtif

我有一个PowerShell脚本,希望使用az lab vm-apply工件将工件添加到vm。谁能给我一个示例工件Json文件,以及如何从Azure CLI调用它? 非常感谢

给我一个示例工件Json文件,以及如何从Azure CLI调用它

以下示例显示了构成定义文件基本结构的部分:

{
  "$schema": "https://raw.githubusercontent.com/Azure/azure-devtestlab/master/schemas/2016-11-28/dtlArtifacts.json",
  "title": "",
  "description": "",
  "iconUri": "",
  "targetOsType": "",
  "parameters": {
    "<parameterName>": {
      "type": "",
      "displayName": "",
      "description": ""
    }
  },
  "runCommand": {
    "commandToExecute": ""
  }
}

谢谢你,乔伊!例如,我在工件JSON中有三个参数。“commandToExecute”是什么样子的?我应该/应该在哪里指定参数值?在JSON文件中还是从Azure CLI作为参数?最佳做法是什么?您能给我一个如何执行的示例吗?就像这样,您可以使用“commandToExecute”:“[concat('powershell.exe-ExecutionPolicy bypass\”&./install-choco-package.ps1-Packages'”,参数('Packages'),'-AllowEmptyChecksums$”,参数('AllowEmptyChecksums'),'IgnoreChecksums$,参数('ignoreChecksums'),'\')]“`来指定参数的值。
az lab vm apply-artifacts --artifacts '@artifacts.json' --lab-name MyLab --name MyVirtualMachine --resource-group MyResourceGroup