Trouble processing parameters when creating a new email in IBM Notes from powershell?

感情迁移 提交于 2019-12-13 20:29:09

问题


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

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

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?


回答1:


Needed to trim the parameter string.

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.

It takes this:

" 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"

and makes it this:

"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"


来源:https://stackoverflow.com/questions/51623043/trouble-processing-parameters-when-creating-a-new-email-in-ibm-notes-from-powers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!