我有一个脚本,可以从Exchange服务器导入会话以使用某些Exchange cmdlet。
如果我运行.ps1脚本,它可以正常工作,但是在我将它转换为ps2.exe的.exe之后,它提示我一些奇怪的错误。
所引用的代码行如下:
$addressbook.Name = $addressbook.Name | Where-Object { $_.DisplayName –ne ("All Users")}
$addressbook.Name = $addressbook.Name | Where-Object { $_.DisplayName –ne ("All Contacts")}
$addressbook.Name = $addressbook.Name | Where-Object { $_.DisplayName –ne ("All Rooms")}
$addressbook.Name = $addressbook.Name | Where-Object { $_.DisplayName –ne ("Public Folders")}
$addressbook.Name = $addressbook.Name | Where-Object { $_.DisplayName –ne ("All Distribution Lists")}
有人可以帮我解决这个问题吗?