Applications Systems
SAM script that includes Windows PowerShell Monitor causes SetBufferContents exception
This article describes how to resolve an error with a script that uses the Windows PowerShell Monitor and results in a log message similar to "Exception calling "SetBufferContents" with "2" argument(s): "The 'SetBufferContents' member is not supported by ApmPsHostRawUserInterface." This issue may be related to the Clear-Host function.
First published date
Last published date
Overview
This article describes how to resolve an exception that may result in a log message similar to:
Exception calling "SetBufferContents" with "2" argument(s): "The 'SetBufferContents' member is not supported by ApmPsHostRawUserInterface.See also Use PowerShell in SAM.
Product section
Cause
- cls
- clear
- [System.Console]::Clear();
Resolution
Do not use the following Clear-Host aliases:
- cls
- clear
- [System.Console]::Clear();