> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/portal/portal-widgets.md).

# Portal Widgets

Discover built-in Portal Widgets in PowerShell Universal, including script forms, tables, and charts, plus how to build custom widgets with PSBlazor.

Widgets are user interfaces blocks built with PowerShell and Blazor. You can create robust web-based used interfaces with minimal web development experience.

## Built In Widgets

PowerShell Universal offers built in widgets to integrate with other features in the platform to display UI elements.

### Script Form

Provide a form for end users to run scripts. Portal access is evaluated in three separate stages:

1. **Listing the script:** The user must have either a matching role under **Script Properties > Portal** or a role assigned to an associated **Display in Portal** tag.
2. **Opening the script form:** The user must have a matching role under **Script Properties > Portal**. Access granted through a tag alone is not sufficient.
3. **Running the script:** The user must have the applicable **Automation Scripts > Execute** permission.

**Important:** Portal roles, tag roles, and Execute permissions do not replace one another. A script can be listed but return **Unauthorized** when opened, or it can open but fail to run if the user does not satisfy all applicable requirements.

Tags also determine where a script is listed:

| Configuration                                                                                | Portal result                                                  |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Matching script Portal role and no tags                                                      | Listed at the Portal root                                      |
| Authorized **Display in Portal** tag                                                         | Listed under the tag                                           |
| Authorized tag but no matching script Portal role                                            | Listed under the tag, but returns **Unauthorized** when opened |
| Matching script Portal role but no Execute permission                                        | Can be listed and opened, but cannot be run                    |
| Only tags without **Display in Portal**                                                      | Not listed, even with a matching script Portal role            |
| Matching script Portal role, Execute permission, and an authorized **Display in Portal** tag | Listed under the tag and can be opened and run                 |

A tag is authorized when **Display in Portal** is enabled and the tag includes a role assigned to the user. If a script has tags, it is not listed at the Portal root. At least one authorized **Display in Portal** tag is required for it to be discoverable.

### Script Table

The script table widget will display a table based on the last output of a script. This selects the most recent job and generates the table based on the properties of the objects returned. For example, try running a script that returns processes on the current machine.

```powershell
Get-Process | Select-Object Name, Id
```

### Script Pie Chart

The script pie chart widget displays a chart based on data from the last run of a script. The script needs to output data in a particular format in order to define the chart's slices. Below is an example of how to generate data for a pie chart.

```powershell
1..5 | ForEach-Object {
    [PSCustomObject]@{ 
        type = "Category $_"
        value = Get-Random -Min 5 -Max 60
    }
}
```

In the properties for the pie chart widget, set the Category Property to `type` and the Value Property `value`.

### Script Line Chart

The script line chart widget displays a chart based on data from the last run of a script. The script needs to output data in a particular format in order to define the chart's lines. Below is an example of how to generate data for a line chart.

```powershell
1..5 | ForEach-Object {
    [PSCustomObject]@{ 
        type = "Category $_"
        value = Get-Random -Min 5 -Max 60
    }
}
```

In the properties for the line chart widget, set the XProperty to `type` and the YProperty to `value`.

## Pre-built Widgets

You can find widgets created by Ironman Software and community members on the[ PowerShell Universal Gallery](/powershell-universal/platform/library.md).

## Custom Widgets

You can develop your own custom widgets using PSBlazor. PSBlazor employs Razor-like syntax combined with PowerShell to allow for creating fully interactive and customizable components.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/portal/portal-widgets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
