azure - Azure 自动化 Powershell Runbook 无法加载程序集
问题描述
我在 azure 门户上运行的代码
Write-Output "Starting"
$assemblyPath = "C:\Modules\Global\Azure\Compute\Microsoft.Exchange.WebServices.dll"
dir $assemblyPath
Write-Output "1"
Add-Type -Path $assemblyPath
Write-Output "2"
输出
对此有任何想法吗?
解决方案
要加载.dll
程序集,您可以参考步骤。
1.在门户->模块->添加模块中导航到您的自动化帐户,将Microsoft.ApplicationInsights.dll
文件压缩为Microsoft.ApplicationInsights.zip
,然后上传。上传后,您将在门户中找到它。
2.更改$assemblyPath
,您的完整命令应如下所示,它将正常工作。
Write-Output "Starting"
$assemblyPath = "C:\Modules\User\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.dll"
dir $assemblyPath
Write-Output "1"
Add-Type -Path $assemblyPath
Write-Output "2"
输出:
推荐阅读
- c++ - 让 cURL 在 64 位机器上与 Visual Studios 2017 32 位一起工作
- c - c编程函数薪水
- project-reactor - 动态合并通量
- javascript - js `Number` 类型加起来会是 Infinity 吗?
- excel - 如何在遵循过滤条件的数据透视表中进行加权平均?
- php - 从 URL 下载图像并上传到 WordPress 媒体库
- ios - 如何解决位置问题:iOS(ipad/iphone)屏幕底部的按钮固定?
- javascript - 我应该如何根据javascript中的参数类返回一个类?
- tensorflow - 如何对tensorflow中的张量执行np.append()类型的操作?
- php - 如何计算每个给定评分的平均评分?