Powershell Quotation Marks Error

Hi all,

I have a Powershell command in the Invoke Powershell Acitivty. This works fine for me in Powershell ISE.

However the command contains quotation marks, which is causing the activity to prompt with the error message - end of expression expected.

Does anyone know how to get around this?

Hi,

The following might help you.

If possible, can you share your command text?

Regards,

Hi Yoichi,

My command text is as follows - Get-ADUser -filter * -properties * | select Displayname, Givenname, Surname, Enabled, EmployeeNumber, EmailAddress, Department, StreetAddress, Title, Country, Office, employeeType, ID, @{Name=“ManagerEmail”;Expression={(get-aduser -property emailaddress $_.manager).emailaddress}}

Thanks

Hi,

Can you try the following?

"Get-ADUser -filter * -properties * | select Displayname, Givenname, Surname, Enabled, EmployeeNumber, EmailAddress, Department, StreetAddress, Title, Country, Office, employeeType, ID, @{Name=""ManagerEmail"";Expression={(get-aduser -property emailaddress $_.manager).emailaddress}}"

Note: " should be "" in string literal.

Regards,

Thank you that has fixed the error!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.