PowerShell

Visualising your IP Address using PowerShell and AI

A few weeks back the Microsoft AI Tour was in Sydney Australia. There was a plethora of great content associated with the wave of everything AI that we are currently in.

I gave a quick-fire series of live demos in a theatre session titled PowerShell & ChatGPT – How to Automate Your Way to Generative AI Brilliance.

The live demos use PowerShell to make web requests and leverage the PowerShellAI PowerShell Module and showed how to leverage Azure OpenAI with PowerShell to;

  • Programmatically get data from OpenAI and work with the results. The demo showed querying OpenAI for the Australian States and Territories returning the results as JSON, converting to a PowerShell Object then querying OpenAI again to get the population of each State and Territory.
  • Create a PowerShell Function that takes a date object as input and calculates the number of days until that date from today
  • Visualise your IP Address. Get your public IP address from http://ipinfo.io that also provides the city location. Query https://api.openweathermap.org for today’s forecast. Then use OpenAI to determine what is the most iconic landmark with a brief description of it for the associated city. Then refine the description of the landmark into 30 words detailing only its key architectural features.
    • Finally using Azure OpenAI Dall-e generate an image in the style of a famous artist (e.g Picasso) of the famous landmark in the associated city with the current weather (e.g. Sunny, Rain, Cloudy).
  • Get a list of the top 5 beers in Australia as JSON, convert to a PowerShell Object and then put the results into an Excel spreadsheet. The later part of this demo uses the ImportExcel PowerShell Module.

The PowerShellAI module cmdlet to leverage Azure OpenAI Dall-e is a new cmdlet that I wrote and submitted as a pull request which has now been incorporated into version 0.97 of the module. To get started with the PowerShellAI Module start with this post.

The example scripts are here in this GitHub repo.

Darren Robinson

Bespoke learnings from a Microsoft Identity and Access Management Architect using lots of Microsoft Identity Manager, Azure Active Directory, PowerShell, SailPoint IdentityNow and Lithnet products and services.

Recent Posts

Where the heck is the PowerShell Module loading from?

If you're anything like me you always have PowerShell open, and often both PowerShell and…

4 months ago

Express Verified ID Setup

Decentralised Identity is a technology I'm passionate about and have written many posts and tools…

5 months ago

Orchestrating 1Password with PowerShell

Over two years ago I authored a PowerShell Module that enabled the automation of 1Password.…

8 months ago

Entra ID Tenant ID & Custom Domains PowerShell Module

Buried in my PowerShell Snippets Vol 4 post from 2021 is the PowerShell script and…

8 months ago

Windows Subsystem for Linux instance has terminated

Short post on how to recovery from "The Windows Subsystem for Linux instance has terminated"…

9 months ago

Goodbye Azure AD, Hello Entra ID

Today Microsoft made big announcements about its Microsoft Entra suite of identity and security products…

9 months ago

This website uses cookies.