从 powershell 在 IBM Notes 中创建新电子邮件时处理参数时遇到问题?

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

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

 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

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

这里有什么东西当存储为字符串时会导致将其作为参数传递时出现问题吗?可能需要 searched/replaced/escaped?

的字符

需要trim参数字符串。

在包含参数的变量中,我需要调用它的 .Trim() 函数来剪掉字符串开头和结尾的 space。在我这样做之后它起作用了。

需要这样:

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