Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 3.01 KB

File metadata and controls

50 lines (33 loc) · 3.01 KB

PresentingPwshSpectreConsole

Contents

Introduction

This repository contains the code samples and resources for the "PresentingPwshSpectreConsole" session. The session will be presented at the Pacific PowerShell User Group.

Shaun Lawrie, a developer from Wellington, New Zealand, will demonstrate how to use the .NET Spectre Console Library in PowerShell to create visually appealing console applications. Shaun has been working on integrating the capabilities of Spectre Console into PowerShell through the PwshSpectreConsole module.

In this session, he will explain how Spectre Console works, detail the implementation of the PowerShell module, and show how you can leverage it to develop beautiful console applications.

Join Shaun to explore the potential of Spectre Console and enhance your PowerShell scripting with a different approach to console interfaces.

What is Spectre Console?

Spectre.Console is a .NET library that allows you to create beautiful console applications. It provides a rich set of features to build interactive command-line interfaces with colors, tables, progress bars, and more.

My journey with Spectre.Console and PowerShell shaunlawrie.com/blog/powershell-spectre-console

PwshSpectreConsole Module

The PwshSpectreConsole module is a PowerShell module that integrates the capabilities of Spectre Console into PowerShell. It provides cmdlets and functions to create visually appealing console applications using the Spectre.Console library, without the need to write C# code.

I used to manage my own escape codes and ANSI sequences to create colorful console applications. However, with Spectre.Console, I can now create beautiful console applications with ease. The PwshSpectreConsole module is a wrapper around the Spectre.Console library, allowing you to leverage its capabilities in PowerShell.

I 💖 PowerShell. All the power of C# without mucking around with build tools.

Demo

I'm going to work through a few examples to demonstrate the capabilities of Spectre.Console and the PwshSpectreConsole module. We'll create a simple console application, add colors, tables, and progress bars, and explore the possibilities of building visually appealing console interfaces with PowerShell.

What data can we use? Formula One?

f1 logo pixels car go vroom

  • Get the data from the API in style https://api.openf1.org/v1/meetings?year=2024
  • Display the data in a table Select-Object circuit_key, meeting_key, location, meeting_name
    • Console output, Out-SpectreHost vs Out-Host
    • Assignment and embedding
  • Get some user input
  • Demo some visuals
  • Documentation
  • Question time