Set-PSUCache, ensure that you set some sort of lifetime to the cache. This is especially important if you have data that isn't being used all the time and is large in size. Data set into the cache without a lifetime is never returned to the system.
ConvertTo-Json. Although the platform restricts the depth of the JSON, highly complex objects can cause the cmdlet to spin out of control and consume high amounts of CPU. PowerShell Universal will attempt to cancel this processing if it is detected but it will still cause issues with your API environment.
Select-Objectto select a subset of the data returned. You can also call
ConvertTo-Jsonyourself to control the
Get-Process. Due to the complexity of the Process type, it causes problems during serialization. Instead, select only a subset of the properties that are required.
Write-Debugthroughout your script, you can disable that via the
$DebugActionPreferencevariable by setting it to
SilentlyContinue. If the job were to start to experience problems, you could set it to
Continueto view the output in the log.
Out-Nullcan capture would-be pipeline output and discard it. If you don't want to discard all pipeline output, you can discard some of it by using
Out-Null. This will improve performance and reduce the size of your job data.
Start-PSUDashboardcmdlets to restart the individual dashboards. This technique is only valid when dashboards are running in non-integrated environments.
New-UDTableColumn, is the ability to render columns to contain any component that you wish to display based on the row of data that you are providing to the table. This is usually useful for customizing the look and feel or by providing actions for the row's data. Rendering can become a performance issue if used incorrectly. Rendering many rows at once or using the render ScriptBlock to run long running processes will cause problems.
-RenderScriptBlock will be called for each item you pass into the data parameter. If you have hundreds or thousands of items, this will cause page load times to increase.
-LoadDatato load and display only a page of data at a time. This only calls
-Renderfor the displayed items and not the entire data set.
-Render, it's not suggested to use long running render operations. If you expect your
-Renderto take more than a few milliseconds, consider using
New-UDDynamicto off load the render back to the server and display a loading skeleton. The server can efficiently schedule the rendering operation using the runspace pool in this case.