从 public 邮箱上的 Outlook 规则调用 PowerShell 脚本
Call PowerShell script from Outlook rule on public mailbox
我希望能够指定一个规则,该规则调用需要 JSON 的 API。要调用此 API,我有一个采用 -Message
参数的 PowerShell 脚本。为此,我 found 下面的 Visual Basic 脚本:
Process.Start("powershell", "-noexit -file 'c:\<path>\file.ps1' -ArgumentList VARIABLE")"
现在我希望在 Outlook 中实施此规则,并且在我的计算机关闭时也能正常工作(因此无法访问 C:/ 我猜)。这可能吗?如果是这样,我走在正确的轨道上吗?
谢谢。
Now I want this rule to be implemented in Outlook and also working while my machine is off (so there is no access to C:/ I guess). Is this possible? And if so, Am I on the right track?
Outlook 规则是客户端的功能。因此,它只能在 Outlook 中为 运行。您需要让 Outlook 运行 使解决方案正常工作。您可以在 Outlook 中创建一个规则,然后分配一个 VBA 宏子,您可以在其中调用所需的 powershell 脚本。 VBA sub 应采用以下格式:
public sub test(mail as MailItem)
'
end sub
其中邮件对象是应用规则的 Outlook 项目。
我希望能够指定一个规则,该规则调用需要 JSON 的 API。要调用此 API,我有一个采用 -Message
参数的 PowerShell 脚本。为此,我 found 下面的 Visual Basic 脚本:
Process.Start("powershell", "-noexit -file 'c:\<path>\file.ps1' -ArgumentList VARIABLE")"
现在我希望在 Outlook 中实施此规则,并且在我的计算机关闭时也能正常工作(因此无法访问 C:/ 我猜)。这可能吗?如果是这样,我走在正确的轨道上吗?
谢谢。
Now I want this rule to be implemented in Outlook and also working while my machine is off (so there is no access to C:/ I guess). Is this possible? And if so, Am I on the right track?
Outlook 规则是客户端的功能。因此,它只能在 Outlook 中为 运行。您需要让 Outlook 运行 使解决方案正常工作。您可以在 Outlook 中创建一个规则,然后分配一个 VBA 宏子,您可以在其中调用所需的 powershell 脚本。 VBA sub 应采用以下格式:
public sub test(mail as MailItem)
'
end sub
其中邮件对象是应用规则的 Outlook 项目。