Troubleshooting Neurons Bots

Console Output Limitations in PowerShell Script Actions

Problem: Errors when running PowerShell script actions, despite the scripts executing successfully on client machines.

Cause: When using PowerShell script actions in Ivanti Neurons for UEM, the Write-Host cmdlet is often used to output data to the console. This information is stored in the action history. However, there is a limited amount of cache space available for these console messages. If the cache limit is exceeded, the action might report an error, even though the PowerShell script continues to run successfully on the client machine.

Resolution

To avoid cache-related errors in PowerShell script actions, consider the following:

  • Be aware of the cache limitations

    • Workflows process devices in chunks of up to 250 devices.

    • Each stage allows up to 10 MB of results.

    • For a full set of 250 devices, the maximum output per device is 40 KB (10 MB / 250 devices).

    • If only one device is processed, it can use the entire 10 MB allocation.

  • Optimize your scripts

    • Limit the use of Write-Host commands to essential information only.

    • Consider using alternative logging methods for verbose output.

    • Summarize results instead of outputting large amounts of data.

  • Test your scripts

    • Run scripts on a small number of devices first to ensure they don't exceed cache limits.

    • Monitor action history and adjust scripts if necessary.

  • Use alternative reporting methods

    • For large data sets, consider writing results to a file on the client machine and use separate methods to collect and analyze this data.

By following these guidelines, you can minimize the risk of cache-related errors in your PowerShell script actions while still collecting necessary information.