从Powershell在IBM Notes中创建新电子邮件时处理参数时出现问题? [英] Trouble processing parameters when creating a new email in IBM Notes from powershell?

查看:153
本文介绍了从Powershell在IBM Notes中创建新电子邮件时处理参数时出现问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个传递给IBM notes的参数,以生成新的电子邮件,该电子邮件将传递给notes.exe,如下所示:

I have a parameter that I pass to IBM notes to generate a new email that is passed to notes.exe as follows:

 mailto:bob@yahoo.com?subject=For Employee Someguy Somsirname?body= Hi, Someguy%0AI am emailing you in regard to Someguy.  Unable his\her Stuff. Please contact his\her.%0A%0A           %0AThank you,%0A            %0A

我希望能够从Powershell调用它,但是当它调用notes.exe时便说There was an error processing command line arguments

I'd like to be able to call this from Powershell, but when it calls notes.exe Notes says There was an error processing command line arguments

如果我只是复制并粘贴上面的参数,并将其放在双引号中,则在powershell中效果很好,但是如果将其作为变量传递,则会导致上述错误.

If I just copy and paste the parameter above and put it in double quotes it works just fine from powershell, but if I pass it as a variable it results in the aforementioned error.

这里是否有任何东西存储为字符串会导致将其作为参数传递时出现问题?可能需要搜索/替换/转义的字符?

Is there any thing here that when stored as a string would cause an issue passing it as a parameter? Characters that might need searched/replaced/escaped?

推荐答案

需要修剪参数字符串.

Needed to trim the parameter string.

在包含参数的变量中,我需要调用它的.Trim()函数以截断字符串开头和结尾的空格.在我这样做之后,它就起作用了.

In the variable that contained the parameters, I needed to call it's .Trim() function to clip off the space at the start and end of the string. After I did that it worked.

需要:

" mailto:bob@yahoo.com?subject=For Employee Someguy Somsirname?body= Hi, Someguy%0AI am emailing you in regard to Someguy.  Unable his\her Stuff. Please contact his\her.%0A%0A           %0AThank you,%0A            %0A"

并做到这一点:

"mailto:bob@yahoo.com?subject=For Employee Someguy Somsirname?body= Hi, Someguy%0AI am emailing you in regard to Someguy.  Unable his\her Stuff. Please contact his\her.%0A%0A           %0AThank you,%0A            %0A"

这篇关于从Powershell在IBM Notes中创建新电子邮件时处理参数时出现问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆