Creating Custom Evergreen Scripts – Web Scraping

0 Shares

I’m a big fan of automation and always installing the latest available version of any software. It takes some time to get going, but after that, each and every time my pipeline build a new Master Image its 100% up to date.

I have a huge library of prescripted applications you can steal with pride over at my Github repo. That repo is step one before they make it into the Evergreen PowerShell Gallery (Works on Windows, MacOS and Linux).

In this post I’m going to show you how we can use PowerShell Web Scraping when API isn’t available. In this example we’re going to use TightVNC. Taking a look at their web site we can see that the heading for new releases are constant “TightVNC for Windows“.

So by using the following code we can grab that heading.

As you can see we have some <h3> tags that we need to get ride off.

Now let’s remove the heading we used for search.

Now let’s remove that ) character at the end.

The final step before we wrap up is removing the white spaces.

When we download the software the URL looks like this: https://www.tightvnc.com/download/2.8.27/tightvnc-2.8.27-gpl-setup-64bit.msi

Clearly we can easily replace that version number with $Version and boom we have made our self an Evergreen script for TightVNC. Make sure to download from Github, the code gets screwed in WordPress.

0 Shares

Automation Framework Community Edition

The fastest way to build your lab environment.

Virtual Expo

Friday 30th of September 2022

3 thoughts on “Creating Custom Evergreen Scripts – Web Scraping”

  1. finding the version number would be easier using regex match:

    $m -match ‘\d{1,2}.\d{1,2}.\d{1,2}’ | %{$Matches.0}

    Reply

Leave a Comment