I tried upgrading to a new version of PostgreSQL and do a fresh install of Postgis from ApplicationStacker.
No matter what I do to add the PostGIS extension i get this error in Pgadmin4:
Could not load library "C:/Program Files/PostgreSQL/11/lib/rtpostgis-2.5.dll": The specified module could not be found. SQL state: XX000
Found the needed file in the correct folder, so it seems to be a problem somewhere else.
I've tried uninstalling PostgreSQL multiple times, but no matter what I did Postgis would not install from SQL. From the stackoverflow post it appears that some Windows dependencies were missing, so that it was unable to detect the files even though it is actually located in the directory. NB: At least now I know what to do when removing PostgreSQL.
Using Google-chan I came across a recent article on stackoverflow.
Thankfully the solution was just to copy libraries from the postgisgui folder to the parent directory.
Once i copied the libraries across to the correct folder, and executing SQL command:
CREATE EXTENSION postgis; we have PostGIS enabled.
What would I do without stackoverflow?
Proof that PostGIS installed successfully...