Skip to content

Commit

Permalink
Change the order of recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwheeler committed Sep 12, 2024
1 parent 45f340b commit 7d9b5b4
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions reference/docs-conceptual/learn/shell/output-for-screen-reader.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: This article aims to guide you through methods to output from PowerShell in formats that are friendly for screen readers, enhancing the accessibility of your scripts.
ms.custom: experience
ms.date: 09/07/2024
ms.date: 09/12/2024
title: Improve the accessibility of output in PowerShell
---
# Improve the accessibility of output in PowerShell
Expand All @@ -12,10 +12,57 @@ accessibility metadata to characterize the format of the content.

There are two ways to improve the accessibility of the output in PowerShell:

- Reduce the amount of output displayed in the terminal by filtering and selecting the data you
want and output the text in a more readable format.
- Output the data in a way that it can be viewed in another tool that supports screen reading
technologies.
- Reduce the amount of output displayed in the terminal by filtering and selecting the data you
want and output the text in a more readable format.

## Display the data in a tool outside of the terminal

For large amounts of data, rather than output to the host, consider writing output in a format that
can be viewed in another tool that supports screen reading technologies. You might need to save the
data to a file in a format that can be opened in another application.

### Out-GridView command on Windows

For small to moderate size output, use the `Out-GridView` command. The output is rendered using
Windows Presentation Foundation (WPF) in tabular form, much like a spreadsheet. The GridView control
allows you to sort, filter, and search the data, which reduces the amount of data that needs to be
read. The GridView control is also accessible to screen readers. The **Narrator** tool built into
Windows is able to read the GridView details, including column names and row count.

The following example shows how to display a list of services in a GridView control.

```powershell
Get-Service | Out-GridView
```

The `Out-GridView` command is only available in PowerShell on Windows.

### Character Separated Value (CSV) format

Spreadsheet applications such as **Microsoft Excel** support CSV files. The following example shows
how to save the output of a command to a CSV file.

```powershell
Get-Service | Export-Csv -Path .\myFile.csv
Invoke-Item .\myFile.csv
```

The `Invoke-Item` command opens the file in the default application for CSV files, which is usually
Microsoft Excel.

### HyperText Markup Language (HTML) format

HTML files can be viewed by web browsers such as **Microsoft Edge**. The following example shows how
to save the output of a command to an HTML file.

```powershell
Get-Service | ConvertTo-HTML | Out-File .\myFile.html
Invoke-Item .\myFile.html
```

The `Invoke-Item` command opens the file in your default web browser.

## Reduce the amount of output

Expand Down Expand Up @@ -84,53 +131,6 @@ ProcessName : msedgewebview2
MemoryMB : 428.94
```

## Display the data in a tool outside of the terminal

For large amounts of data, rather than output to the host, consider writing output in a format that
can be viewed in another tool that supports screen reading technologies. You might need to save the
data to a file in a format that can be opened in another application.

### Out-GridView command on Windows

For small to moderate size output, use the `Out-GridView` command. The output is rendered using
Windows Presentation Foundation (WPF) in tabular form, much like a spreadsheet. The GridView control
allows you to sort, filter, and search the data, which reduces the amount of data that needs to be
read. The GridView control is also accessible to screen readers. The **Narrator** tool built into
Windows is able to read the GridView details, including column names and row count.

The following example shows how to display a list of services in a GridView control.

```powershell
Get-Service | Out-GridView
```

The `Out-GridView` command is only available in PowerShell on Windows.

### Character Separated Value (CSV) format

Spreadsheet applications such as **Microsoft Excel** support CSV files. The following example shows
how to save the output of a command to a CSV file.

```powershell
Get-Service | Export-Csv -Path .\myFile.csv
Invoke-Item .\myFile.csv
```

The `Invoke-Item` command opens the file in the default application for CSV files, which is usually
Microsoft Excel.

### HyperText Markup Language (HTML) format

HTML files can be viewed by web browsers such as **Microsoft Edge**. The following example shows how
to save the output of a command to an HTML file.

```powershell
Get-Service | ConvertTo-HTML | Out-File .\myFile.html
Invoke-Item .\myFile.html
```

The `Invoke-Item` command opens the file in your default web browser.

## Additional reading

- [Out-GridView](xref:Microsoft.PowerShell.Utility.Out-GridView)
Expand Down

0 comments on commit 7d9b5b4

Please sign in to comment.