Passing empty value to PowerShell script in Run PowerShell Script activity RRS feed

  • Question

  • Hi everybody!

    I'm trying to run PowerShell script setting user photo in Exchange.

    The first script's parameter is user's account name and the second is user's photo.

    If a user has no photo I've got error:

    WAL (2.16.0305.0): 11/22/2016 12:02:05.3145: RunPowerShellScript : <SetupStreamEventHandlers>b__0: Cannot bind argument to parameter 'PictureData' because it is an empty array.

    It is expectable, but the error appears even if I configure Activity Execution Condition to bypass script execution when the photo is not present.

    As I can understand the activity first performs parameters binding and then checks execution condition.

    Maybe it would be better to do it in reverse order? Anyway it seems more "logical" first check if activity should be executed at all and then do any other actions.

    Any thoughts?

    Tuesday, November 22, 2016 12:16 PM


All replies

  • What is your Activity Execution Condition? It it's not satisfied, your script will not run or attempted to be run which is where the error is coming from.
    Tuesday, November 22, 2016 12:49 PM
  • I beg your pardon, there was a mistake in execution condition.

    Everything is fine, thank you.

    Tuesday, November 22, 2016 1:38 PM