PowerShell Universal
Ironman SoftwareForums
v2
v2
  • About
  • Get Started
  • Additional Resources
  • Installation
    • Docker
    • Upgrading
  • Licensing
  • System Requirements
  • Supported Browsers
  • Cmdlet Help
  • Templates
  • API
    • About
    • Endpoints
    • Security
    • Error Handling
    • Rate Limiting
  • Automation
    • About Automation
    • Scripts
      • Parameters
    • Jobs
    • Schedules
    • Terminals
    • Triggers
  • User Interfaces
    • About
    • Dashboards
      • Building Dashboards
      • Components
        • Dashboards
        • Pages
        • Dynamic Regions
        • Element
        • Error Boundary
        • HTML
        • Building Custom Components
        • Data Display
          • Alert
          • Chip
          • Date and Time
          • Icon
          • List
          • Table
          • Tree View
          • Typography
        • Data Visualization
          • Charts
          • Map
        • Feedback
          • Backdrop
          • Modal
          • Progress
          • Skeleton
        • Inputs
          • Autocomplete
          • Button
          • Checkbox
          • Code Editor
          • Date Picker
          • Editor
          • Floating Action Button
          • Form
          • Radio
          • Select
          • Slider
          • Switch
          • Textbox
          • Time Picker
          • Transfer List
          • Upload
        • Navigation
          • Drawer
          • Link
          • Menu
          • Stepper
          • Tabs
        • Layout
          • Grid Layout
          • Grid
          • Hidden
        • Utilities
          • Transitions
        • Surfaces
          • AppBar
          • Card
          • Paper
          • Expansion Panel
      • Interaction
      • Marketplace
      • Role Based Access
      • Scheduled Endpoints
      • Sessions
      • Themes
        • Cascading Style Sheets
        • Styles
      • Custom Variable Scopes
      • Migrating From Universal Dashboard 2.9
    • Pages
      • Alerts
      • Bar Chart
      • Button
      • Form
      • iFrame
      • Image
      • Line Chart
      • Liquid Chart
      • Paragraph
      • Statistic
      • Table
      • Variables
  • Platform
    • Cache
    • Desktop Mode
      • Hotkeys
    • Modules
    • Monitoring
    • Published Folders
    • Templates
    • Variables
  • Configuration
    • About
    • API
    • Environments
    • Git
    • Hosting
      • Azure
      • IIS
      • Single-File
    • Login Page
    • Management API
    • Settings
    • Security
      • Access Controls
      • App Tokens
      • Client Certificate
      • OpenID Connect
      • SAML2
      • WS-Federation
    • Repository
    • Running as a Service Account
  • Development
    • Debugging Scripts
    • Editor
    • Hangfire
    • Logging
    • Profiling
    • Visual Studio Code Extension
  • Changelog
  • Extension Changelog
  • Legacy Universal Dashboard Docs
Powered by GitBook

Copyright 2025 Ironman Software

On this page
  • Enable Profiling
  • Access Profiling Data
  • Profiling an API Endpoint
  • Profiling a Dashboard
  • Profiling a Job

Was this helpful?

  1. Development

Profiling

Performance profiler for PowerShell Universal.

PreviousLoggingNextVisual Studio Code Extension

Last updated 3 years ago

Was this helpful?

Available in PowerShell Universal 2.8.2 or later. Profiling only works for the integrated environment.

PowerShell Universal provides a performance profiler for debugging issues where the platform may exhibit slow responses. This is primarily useful when building Dashboards.

Enable Profiling

Profiling will increase memory usage as profiling data is stored in memory. You can enable profiling by configuring the Profiling appsettings.json property. It is false by default. You will need to restart PowerShell Universal after enabling or disabling profiling.

"Profiling": true

Access Profiling Data

You can access profiling data by navigating to /profiler/results-index . You will need to be logged in as administrator before being able to access this URL.

You will see a list of requests and their timings.

Clicking on the request will display a break-down of the timings.

Profiling an API Endpoint

You can profile an API endpoint using Measure-PSUBlock. The API will be listed by URL in the result index.

For example, assume an API called /process.

New-PSUEndpoint -Url "/process" -Endpoint {
    Measure-PSUBlock -Name 'Api' -ScriptBlock {
        Get-Process | Select-Object name
    }
} -Authentication -Timeout 0 

The result of profiling this API would be listed by URL.

Viewing the profile for this API would list the block we measured.

Profiling a Dashboard

Measure-UDBlock is an alias for Measure-PSUBlock

You can use the built-in profiler with Dashboards. By default, certain internal action timings are recorded. You can also use the Measure-PSUBlock cmdlet to measure specific blocks within your dashboard.

For example, this dashboard uses Measure-UDBlock to measure the performance of the Start-Sleep cmdlet. The result is the block will take one second to execute.

New-UDDashboard -Title 'Dashboard' -Content {
    New-UDDynamic -Id 'MyElement' -Content {
        Measure-UDBlock -Name 'WithinDashboard' -ScriptBlock {
            Start-Sleep 1
        }
    }
}

When reviewing requests within the profiler, you will want to look for UDComponent\ElementPost and UDComponent\Element. These are requests for elements within Dashboards.

Below is the example output from the dashboard shown above. Notice that the URL includes the element's ID MyElement. You'll also notice that the WithinDashboard block takes about 1 second.

Not all timing will be displayed by default. You can click show trivial to expand all timings.

Profiling a Job

You can profile jobs by using Measure-PSUBlock within your script.

For example, assume we have a script that calls Get-Service.

Measure-PSUBlock -ScriptBlock {
    Get-Service
} -Name 'Get-Service'

Running a profile on this script will list the job as JobProfiler/{id}. The id will match the job ID shown in the admin console.

The profile will include the block that was measured.

Result Index
Timings
Dashboard Timing
All Timings