0
Completed

ConfigureEventBrokerChangesActivity.ps1 throws ReadKey exceptions when run in ISE

Bob Bradley 3 years ago • updated by anonymous 3 years ago 4

While the activity (AIC) installs correctly, the installer PowerShell script throws errors when run via the ISE:

PS C:\FIM Installers> C:\FIM Installers\FIMEventBrokerWorkflow.ps1

PS C:\FIM Installers> C:\FIM Installers\ConfigureEventBrokerChangesActivity.ps1
This script will add the required Activity Information Configuration to the FIM instance for the Event Broker Changes Activity. Press any key to continue.
Exception calling "ReadKey" with "1" argument(s): "The method or operation is not implemented."
At C:\FIM Installers\ConfigureEventBrokerChangesActivity.ps1:37 char:1
+ $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NotImplementedException
 
Import complete. Verify that the Event Broker Changes Activity is correctly listed in the Activity Information Configuration. Press any key to finish.
Exception calling "ReadKey" with "1" argument(s): "The method or operation is not implemented."
At C:\FIM Installers\ConfigureEventBrokerChangesActivity.ps1:68 char:1
+ $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NotImplementedException

Hi Bob Bradley, I'm considering resolving this as won't fix, as it doesn't make sense to run this in ISE (it's a script to run as is, not something that is developed/debugged by the client). See here for details on the issue.

I wouldn't have bothered logging this error if I wasn't thinking about others who may run into the same issue, and from your link it's good to see that I'm not the only one to run into this problem Adam van Vliet - I don't know about other people, but rightly or wrongly, when it comes to deploying FIM solution components, or doing anything with PowerShell, I am not in the habit of running scripts any other way. A comment in the documentation noting the behaviour in the ISE would be adequate here, stating that the preference is to NOT run this via the ISE (that is unless you want to consider a work-around like the blogger posted https://adamstech.wordpress.com/2011/05/12/how-to-properly-pause-a-powershell-script/.

Thanks for logging it Bob Bradley. Created EB-671 to document the issue.