azure - Invoke-AzVMRunCommand - 错误处理的最佳实践?

标签 azure powershell error-handling try-catch

我想在 azure 虚拟机上部署多个脚本。 我使用 Invoke-AzVMRunCommand。

实现良好错误处理的最佳实践是什么?

有什么例子吗?

最佳答案

Invoke-AzVMRunCommand 假设在操作系统级别运行脚本。

如果 Invoke-AzVMRunCommand 出错,您可以对其进行唯一的错误处理 erroractionerrorvariable

如果脚本本身出错,运行命令将不会有任何相关信息。

关于azure - Invoke-AzVMRunCommand - 错误处理的最佳实践?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56583814/

相关文章:

c# - 如何将已发布的 Web 应用程序从 azure 导入到 Visual Studio for Web

azure - 如何在 ADO 管道中使用 Powershell 模块?

r - 错误 : [on_request_read] connection reset by peer in R shiny

javascript - Azure 翻译 API - 限制客户端请求

Azure Bicep( key 保管库 secret 作为参数传递给本地变量)

string - 计算字符串中的字符串数?

Powershell:如何将空正文传递给 Send-MailMessage?

c++ - 程序是否应该检查 "shouldn' t"但可以失败的 WinAPI 函数的失败?

python - Win32com.client com_error

azure - 如何通过组织帐户或 Active Directory 访问 Azure Server