首页 > 解决方案 > Azure Functions Powershell:无法通过托管依赖项加载模块

问题描述

我们在导入库表单 powershellgallery.com: IntuneWin32App时遇到问题。错误消息如下:

"ERROR: The 'New-IntuneWin32AppPackage' command was found in the module 'IntuneWin32App', but the module could not be loaded."

我们正在运行 Azure 函数 3、Powershell 7.1。IntuneWin32App 通过托管依赖项导入。在“requirements.psd1”中指定如下:

'IntuneWin32App' = '1.*'

我们已经尝试了几种解决此错误相关问题的解决方案,但没有一个可以帮助我们。

编辑:详细输出:https ://pastebin.com/t3kBF00A

我们还将该功能部署到云环境中,并且我们正在那里检索相同的问题。

标签: azurepowershellazure-functions

解决方案


[2021-07-30T06:54:54.792Z] ERROR: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.

模块是否需要身份验证?它似乎正在尝试启动 PowerShell 7 中不可用的 winforms 窗口。

是否有另一种身份验证机制可以与该模块一起使用,例如阻止窗口的服务主体或证书?


推荐阅读