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 7 kwietnia, 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

Upgrade Azure Active Directory Connect fails with unexpected error

Today, I made the decision to upgrade my test environment and update the version of…

5 dni ago

Mastering Active Directory Hygiene: Automating Stale Computer Cleanup with CleanupMonster

Have you ever looked at your Active Directory and wondered, "Why do I still have…

4 miesiące ago

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…

8 miesięcy 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…

1 rok 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…

1 rok 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…

1 rok ago