简体   繁体   English

将兑换程序集添加到PowerShell脚本

[英]Adding Redemption assembly to PowerShell script

I recently posted a question about a problem I was having with my powershell script here . 我最近发布了关于我和我的PowerShell脚本有一个问题,问题在这里 The helpful people here guided me to the solution which was using Redemption library. 乐于助人的人们将我引向了使用Redemption库的解决方案。

After looking in to what Redemption is, and what it can do, I decided to give it a go and install the files. 在了解什么是“兑换”以及它可以做什么之后,我决定尝试一下并安装文件。 Now I'm facing the problem where I can't quite ComObjects of Redemption. 现在,我面临的问题是我无法完全使用ComObjects of Redemption。

My Code: 我的代码:

$routlook = New-Object -COM Redemption.RDOSession
$routlook.Logon

$junk = $routlook.GetDefaultFolder($OlFolderJunk)
$MI = $box.items

$MI|select  SenderName, SenderEmailAddress, To, Subject, Body

The goal is to just simply show the fields listed above in a table. 目的是仅在表中简单显示上面列出的字段。 I want to see the sender's name, the sender's e-mail address, the recipient, the subject and the content (or body) 我想查看发件人的姓名,发件人的电子邮件地址,收件人,主题和内容(或正文)

The Return Value (The Error) 返回值(错误)

在此处输入图片说明

I'm assuming this has something to do with the the missing assembly reference? 我假设这与缺少的程序集引用有关? If so please explain how I add this library to the assembly, cause I'm quite new to Powershell scripting. 如果是这样,请解释我如何将此库添加到程序集中,因为我对Powershell脚本还很陌生。

Thank you. 谢谢。

尝试在PowerShell x32 Bit中加载它,或获取x64 Bit dll版本

This error is an indication that bitness of your code is different from the bitness of the MAPI system (Outlook). 此错误表明您的代码的位数与MAPI系统(Outlook)的位数不同。 See http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject 请参阅http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM