PowerShell

Out-HtmlView – HTML alternative to Out-GridView

One of the most comfortable output's in PowerShell to work and analyze data is Out-GridView. It's handy as you can search, sort and have things done quicker than trying to do things in the console. However it's currently not available in PowerShell Core (PowerShell 6+), and when it is available in PowerShell 7, it will NOT be cross-platform.  Since I had released Dashimo a few days ago, I thought it was trivial to make a simple command out of it that could solve this problem.

PowerShell Out-HtmlView - In action on MacOS

Actually, it brings a couple of other features into the mix. It adds export to CSV, export to Excel and export to PDF at the same time. Here's Out-HtmlView in action on MacOS.

Easy to use, sorting, search, export, and very fast. Keep in mind that Safari by default has blocked running of JavaScript for local files. To use this function you need to enable Developer tools in Preferences, and then under menu Develop, you can select “Disable Local File Restrictions” there. Chrome doesn't have those limits on MacOS so should work straight away.

PowerShell Out-HtmlView - In action on Windows

And here's a little demo on Windows 10. It works in Powershell 5.1 and higher. I've not tested on lower versions, but since I never paid attention to compatibility, I doubt it will work.

Installation and usage

Out-HtmlView is part of  PSWriteHTML module. Please keep in mind that if you used it before you need to use FORCE parameter to make sure it updates any other required modules.

Install-Module PSWriteHTML -Force

Usage is as easy as it gets

Get-Process | Select-Object -First 100 |Out-HtmlView
Get-Process | Select-Object -First 5 |Out-HtmlView

# Keep in mind that Get-Process holds a lot of data so displaying all rows will take a minute to generate
Get-Process | Out-HtmlView
Get-ChildItem | Out-HtmlView

PS. I've created an alias for Out-HtmlView to Out-GridHtml so that it can be easier for people having a habit typing Out-GridView on MacOs or Linux.

This post was last modified on April 7, 2019 23:08

Przemyslaw Klys

System Architect with over 14 years of experience in the IT field. Skilled, among others, in Active Directory, Microsoft Exchange and Office 365. Profoundly interested in PowerShell. Software geek.

Share
Published by
Przemyslaw Klys

Recent Posts

Active Directory Replication Summary to your Email or Microsoft Teams

Active Directory replication is a critical process that ensures the consistent and up-to-date state of…

2 weeks ago

Syncing Global Address List (GAL) to personal contacts and between Office 365 tenants with PowerShell

Hey there! Today, I wanted to introduce you to one of the small but excellent…

5 months ago

Active Directory Health Check using Microsoft Entra Connect Health Service

Active Directory (AD) is crucial in managing identities and resources within an organization. Ensuring its…

7 months ago

Seamless HTML Report Creation: Harness the Power of Markdown with PSWriteHTML PowerShell Module

In today's digital age, the ability to create compelling and informative HTML reports and documents…

8 months ago

How to Efficiently Remove Comments from Your PowerShell Script

As part of my daily development, I create lots of code that I subsequently comment…

9 months ago

Unlocking PowerShell Magic: Different Approach to Creating ‘Empty’ PSCustomObjects

Today I saw an article from Christian Ritter, "PowerShell: Creating an "empty" PSCustomObject" on X…

9 months ago