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.

GitHub – darrenjrobinson/MSAITour: Example Code from MS AI Tour Sydney Session DIS413AU – 7 Feb 2024

Example Code from MS AI Tour Sydney Session DIS413AU – 7 Feb 2024 – darrenjrobinson/MSAITour