PowerShell Universal
DownloadsIssuesDiscordForums
v4
v4
  • About
  • What's New in v4?
  • Get Started
  • Additional Resources
  • Installation
    • Docker
    • Upgrading
    • Uninstall
  • Licensing
  • System Requirements
  • Supported Browsers
  • Cmdlet Help
  • API
    • About
    • Endpoints
    • Event Hubs
    • Security
    • Error Handling
    • Rate Limiting
  • Automation
    • About Automation
    • Scripts
      • Parameters
    • Jobs
    • Schedules
    • System Events
    • Terminals
    • Triggers
    • Queues
  • User Interfaces
    • About
    • Apps
    • Examples
    • Components
      • Pages
      • Dynamic Regions
      • Element
      • Error Boundary
      • HTML
      • Custom Components
        • Building Custom JavaScript Components
      • Data Display
        • Alert
        • Badge
        • Chip
        • Data Grid
        • Date and Time
        • Icon
        • List
        • Markdown
        • Table
        • Timeline
        • Tooltip
        • Tree View
        • Typography
      • Data Visualization
        • Charts
        • Image
        • Map
      • Feedback
        • Backdrop
        • Modal
        • Progress
        • Skeleton
      • Inputs
        • Autocomplete
        • Button
        • Checkbox
        • Code Editor
        • Date Picker
        • Editor
        • Floating Action Button
        • Form
        • Radio
        • Rating
        • Select
        • Slider
        • Switch
        • Textbox
        • Time Picker
        • Transfer List
        • Upload
      • Navigation
        • Drawer
        • Link
        • Menu
        • Stepper
        • Tabs
      • Layout
        • Grid Layout
        • Grid
        • Hidden
        • Stack
      • Utilities
        • Protect Section
        • Transitions
      • Surfaces
        • AppBar
        • Card
        • Paper
        • Expansion Panel
    • Custom Variable Scopes
    • Interaction
    • Role Based Access
    • Scheduled Endpoints
    • Sessions
    • Themes
      • Cascading Style Sheets
      • Styles
  • Desktop
    • About Desktop Mode
    • File Associations
    • Hotkeys
    • Pages
    • Protocol Handlers
  • Platform
    • Cache
    • Computers
    • Health Checks
    • Middleware
    • Modules
    • Monitoring
    • Notifications
    • Plugins
    • Published Folders
    • Templates
    • Translations
    • User Sessions
    • Variables
  • Configuration
    • About
    • API
    • Command Line Options
    • Environments
    • Feature Flags
    • Git
    • Hosting
      • Azure
      • High Availability
      • IIS
      • Reverse Proxy
    • Login Page
    • Management API
    • Persistence
    • App Settings
    • Security
      • Access Controls
      • App Tokens
      • Client Certificate
      • OpenID Connect
      • PowerShell Protect
      • SAML2
      • WS-Federation
    • Repository
    • Running as a Service Account
    • Best Practices
  • Development
    • Debugging Scripts
    • Editor
    • Hangfire
    • Logging
    • Profiling
    • Visual Studio Code Extension
  • Samples
    • APIs
      • Custom Status Codes
    • Apps
      • Active Directory Tree View
      • Export-CSV Download
      • Dynamic Select Dropdown
      • Textbox Length Validation
      • Tree View Font Size
      • SQL Data Grid
  • Changelogs
    • Changelog
    • Extension Changelog
Powered by GitBook

PowerShell Universal

  • Downloads
  • Pricing
  • Gallery

Community

  • Issues
  • Forums
  • Discord

Support

  • Portal
  • Knowledgebase

Copyright 2025 Ironman Software

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

Was this helpful?

Edit on GitHub
Export as PDF
  1. Development

Profiling

Performance profiler for PowerShell Universal.

PreviousLoggingNextVisual Studio Code Extension

Last updated 1 year ago

Was this helpful?

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 an App

Measure-UDBlock is an alias for Measure-PSUBlock

You can use the built-in profiler with Apps. 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 app uses Measure-PSUBlock to measure the performance of the Start-Sleep cmdlet. The result is the block will take one second to execute.

New-UDApp -Title 'App' -Content {
    New-UDDynamic -Id 'MyElement' -Content {
        Measure-PSUBlock -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 Apps.

Below is the example output from the app 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