如何在 Azure webjobs 中加载外部模块 Powershell

How to load external module Powershell in Azure webjobs

我想 运行 Azure webjobs 上的 PowerShell 脚本,我需要在 Azure Webjobs 中为我的业务安装 SharePointPnPPowerShellOnline 模块,但我无法安装外部模块。我也尝试配置 'modules' 文件,例如 Azure 函数,但它不起作用。 我如何使用 Install-Module 或 Azure Webjobs 中的等效项? 感谢您的帮助。

在 Azure Webjob 中加载外部模块。我们需要访问 SCM 然后选择一些目录并将模块放入您的目录

终于使用应用此代码

$MyModulePath="yourPath"
$env:PSModulePath = $env:PSModulePath + "$([System.IO.Path]::PathSeparator)$MyModulePath"