- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Azure Functions,特别是 PowerShell 脚本函数。我想知道如何使用连接到 SharePoint Online 的脚本。
要针对 SharePoint Online 运行,我通常会使用“SharePoint Online Management Shell”,这是预加载 SharePoint Online 库的 PowerShell 版本,以便我可以使用 Get-SPOSite 等方法。
如何将此库包含在我的 Azure Function PowerShell 脚本中,以便我可以使用这些函数?我假设我需要在脚本顶部加载库,但如何加载库?
我已将 DLL 上传到我的函数中并尝试使用:
[System.Reflection.Assembly]::LoadFrom('Microsoft.Online.SharePoint.Client.Tenant.dll')
但这似乎不起作用。我认为我的问题是我不知道上传文件的绝对路径。这是我在左侧 Pane 中看到的:
但是我不知道这些文件的路径是什么。
有什么想法吗?目前,Azure Functions 的文档令人沮丧。
最佳答案
Azure Functions 目录的路径是
D:\home\site\wwwroot\<YourFunctionName>
在最新的 Azure Functions 版本(0.3 版)中,我们支持代表您加载 DLL。您需要创建一个名为 modules 的文件夹并将 DLL 上传到该文件夹中。事实上,您现在可以将脚本 (.psm1)、二进制 (.dll) 和 list (.psd1) 模块上传到 modules 文件夹中,它们将在执行脚本之前自动加载。
让我们使用示例 MyMathLib组装作为引用。
假设您有一个名为RunSimplePowerShell 的函数,并且已将名为MyMathLib.dll 的自定义库上传到如下文件夹中,
D:\home\site\wwwroot\RunSimplePowerShell\modules\MyMathLib.dll
然后,您的名为 run.ps1 的 PowerShell 脚本位于
D:\home\site\wwwroot\RunSimplePowerShell\run.ps1
可以这样写,
[MyMathLib.Methods]::Sum(5, 2)
$calculatorInstance= New-Object MyMathLib.Methods
$calculatorInstance.Product(5,2)
借助 Azure Functions 0.3 版,您现在可以跳过这一行
[Reflection.Assembly]::LoadFile("D:\home\site\wwwroot\RunSimplePowerShell\MyMathLib.dll")
关于sharepoint-online - 天蓝色函数 : PowerShell Script Interacting with SharePoint Online,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38119501/
任务是编写代码,将敏感度标签应用于 SharePoint Online 文档库中的文档,而无需下载文件。 到目前为止,我已经探索了以下 API: SharePoint REST API v1 :可用于
期望的行为 将托管在 SharePoint Online 上的 Excel 文档嵌入到 HTML 页面中。 实际行为 嵌入加载,但是没有水平滚动条。 获取视口(viewport)右侧数据的唯一方法是单
我想在数据中心选择一个事件分区。通常我会使用以下语句: INVANTIVE> use 1552839 2> Exclamation itgendhb077: Error in Invantive Da
我正在使用 Azure Functions,特别是 PowerShell 脚本函数。我想知道如何使用连接到 SharePoint Online 的脚本。 要针对 SharePoint Online 运
我正在尝试使用 API 按姓名查询客户。具有非 ASCII 字符的名称(例如 민준 或 Włodarski)会导致查询失败。这是一个示例查询: SELECT * FROM Customer WHERE
我已经将一个SharePoint列表从2019年迁移到365年。该列表具有NINTEX形式,而该NINTEX形式具有较少的JavaScript文件。在SP Online中,NWF$().SPServi
我正在尝试在内存中生成 PDF 以将其发送到 WS。此 PDF 应在内存 (Stream) 和 Microsoft CRM“云”中的插件代码中创建。这可能吗? 在插件中(已经编码和部署)我有这行,第
当我使用 Invantive Data Hub 从多个 Exact Online 公司下载数据时,我得到了重复的行,而我希望每个公司只有一行。 我使用以下查询: select gla.code ,
我们刚刚上线 https://ecotaksen.be 。 Exact 上的查询和更新运行良好,但安装生产许可证后出现错误 itgenobr001:找不到客户端。。 我的数据容器规范是: 使用具有相
我在 Dynamics CRM Online 2015 中创建了一个插件,用于在 SharePoint Online 文档库中创建文件夹。该插件工作正常。但是,我想在 CRM 中的帐户名称更改时重命名
我正在关注 this blog在 SPFX 部分实现 fluentUI,但在执行“Gulp Build”时出现以下错误: Error - [tsc] node_modules/@fluentui/re
我能够在桌面 .Net 项目中通过 MSAL 检索和使用访问 token 。我可以成功检索 token ,并且它们在我的 Graph 调用中有效。 但是,尝试将访问 token 与 SharePoin
为了遵守法规,我尝试从我的一些部门下载采购发票文件(PDF 文件),将它们保存在磁盘上以供存档。 我使用 Invantive 查询工具来执行此操作。我想知道使用哪个表以及如何仅针对采购发票文档导出这些
我正在开发一个基于 Spring-MVC 的 Web 应用程序,该应用程序使用 Cometd 进行聊天。为了实时管理哪些用户在线,我们在用户在线时发送通知。因此,当窗口关闭时,不会出现通知,并且 30
我在 Visual Studio Online 上使用 GIT 进行源代码管理。我想将一个项目从我的个人 VSO 账户转移到我的企业 VSO 账户。例如。从 account1.visualstudio
当我关闭 Word Online 中的对话框时,我在控制台中收到以下消息: Unknown conversation Id. 我不是得到一个可以处理的代码,而是得到...... (macOS/Chro
短版:如何加载 PowerApps 中托管元数据字段的所有可用选项? 长版: 我有一个正常工作的 PowerApps 应用程序,但用户希望能够在离线时添加数据,并在再次在线时同步回来。官方 Power
我是 QuickBooks 的新手,我所有的搜索都导致了相互矛盾的答案。我真的需要知道这一点才能继续前进。 我们有一个本地应用程序(如果重要的话,旧版 MFC 应用程序)。我们的一些客户使用 Quic
这是我的代码,我尝试使用 countOnline 函数计算我们有多少在线用户。 我遇到错误“无法读取未定义的‘在线’属性”; function countOnline(usersObj) { le
如果我们有一个巨大的事实表并想要添加一个新维度,我们可以这样做: BEGIN TRANSACTION ALTER TABLE [GiantFactTable] ADD NewDimValueId IN
我是一名优秀的程序员,十分优秀!