Friday, October 23, 2015

Exception calling ReadKey with 1 argument(s): The method or operation is not implemented

I was recently developing and executing a PowerShell script when I suddenly encountered the following error message:

Exception calling "ReadKey" with "1" argument(s): "The method or operation is not implemented."

I was very confused by this error message since this was documented as the recommended method of pausing a PowerShell script:

Unfortunately, what was not mentioned in the article was that it does not work in the PowerShell ISE!

Since I develop ALL of my PowerShell scripts in the PowerShell ISE, this functionality seemed to frustrate me immensely.

I was able to find a workaround that also worked in the PowerShell ISE by following this article:

However, it still irks me that Microsoft has not found a reliable "pause" function that works just as well in the PowerShell console as in the PowerShell ISE.

If you would like Microsoft to remedy this issue for the next release of PowerShell, you should vote for this Microsoft Connect feedback item:

No comments:

Post a Comment