Home Blog Finding the Current ISESteroids Version
 

Finding the Current ISESteroids Version

You are soooo creative! Yes, we did have a bunch of updates lately. So what does an automation person do? Automate it!

Please note: We meanwhile created a much faster approach, without the need to HTML scrape anything. So this article is now somewhat obsolete, and we will not maintain the URL with the most current ISESteroids version anymore that was used in some examples below. Here is the new approach.

Update via PowerShellGet

Typically, it’s easy to update ISESteroids. Just run this:


Get-InstalledModule -Name IseSteroids | Update-Module

But what if you can’t use PowerShellGet and had to install ISESteroids manually? Then you cannot use Update-Module.

Update via HTML Scraping

Here’s a great solution by ScriptingFee:

ISESteroids auf aktuellem Stand halten (keep ISESteroids current)

I know “ScriptingFee” from psconf.eu (BTW save the date: May 2-5, 2017 will be the next greatPowerShell Conference Europe!). She’s awesome, and she just scraped the version information from our version history site.

Unfortunately, we never had the time to split it in parts, so today the version history list is pretty long. That’s why I quickly added a new page:

Current ISESteroids Version

Not the perfect solution but much shorter at least. So inspired by her approach, here is some code that will tell you your current ISESteroids version, and the most up-to-date version:

#requires -Modules ISESteroids
#requires -version 3.0
# idea by scriptingfee: http://scriptingfee.de/isesteroids-auf-aktuellem-stand-halten/

$result = Invoke-WebRequest -Uri 'http://www.powertheshell.com/currentversion'
if ($result.Content -match  "(?m)(?<=<p>).*?(?=</p>)")
{
  $info = [PSCustomObject]@{
   InstalledVersion = (Get-SteroidsVersion).toString()
   MostUpToDateVersion = $matches[0]
  }

  $info
}
else
{
   Write-Warning "Unable to reach powertheshell.com."
}

And this is what the result looks like:

PS C:\Users\tobwe> . 'C:\Users\tobwe\Documents\powershell\Untitled2.ps1' <# script is not saved yet #>

InstalledVersion MostUpToDateVersion
---------------- -------------------
2.6.2.31         2.6.2.31



PS C:\Users\tobwe>

So I am safe. For now. I do need to remember to always update the version page, though.

Oh, before I forget: we are finally adding decent documentation to ISESteroids. If you did update to the latest version, you now can produce great-looking HTML snippets from your PowerShell code and console output. All the “screen shots” on this page were created this way. Here are more details about the new Code2HTML feature.

May the PowerShell be with you…!

-Tobias