#
Image2Text Powershell Module
#
Just looking for something new 👁️
So looking to hopefully inspire others and make you yes you the reader, believe in yourself more to do what-ever you may think is awesome in Powershell and wham it on the gallery for all other Powershell users to use some of your own handy-work. I was just browsing and thought about ASCII art and how 😎 cool it looks. So not wanting to reinvent-the-wheel I checked the powershell gallery to see if anyone else had been bold :bold_man: enough to take up the challenge. The only thing I could find was one ASCII text generator. So next step I went to nuget.org to see what C sharp libraries were availble for this. I found a few but these seemed to be built into a form with a browse button. I just wanted a command-line version. Then I found this:-
#
Not quite the same 🤷♂️
Although this whole website has been done using the Retype Powershell module. When I got hold of that package it downloaded the .exe and I could then turn that into several binary cmd-lets. However when I used the download syntax for this project not much happened. So I was left thinking, so decided to go to bed. Then sadly one of my younger daughters was really being sick a lot, and not wanting to go to bed with her just being randomly sick, I thought I would do some coding whilst making sure my daughter was okay whilst being sick, as bless her she wasn't even waking up properly...Anyways this then led to a 💡 idea that I needed to downlaod a copy of the github repository containing this command-line program then build it. Well the first 🦘 hurdle I had to get over was that I couldn't build the project until I had installed dotnet core 3. Due to me using a rather decrepit personal laptop I use, yes I am still using x86 I downloaded the following:-
#
Ran a few tests 🏃
From this To this
For some reason though I could not seem to get the braille to work. Although I wasn't getting any errors nothing happened. So I just stuck with the pure ASCII format this can produce, which I got to say is rather amazing, like super detailed. For me by the time I had dealt with lots of sick, and with it being early hours of the morning I really needed to get to bed for work the next day. (I can look into this further should this module explode in download numbers)
#
Mistakes we all make them 🧪
So although it seemed a really good idea to do all this coding and do an initial release of the module at silly-o-clock in the morning it kind of back-fired. I didn't fully realise that you would need that dotnet 3 core link I posted to run the module. Then again I made the bad, thinking yeah people will know to add this to their environment path. So I made some brief notes on the project page I have for this module of installing that
Then I also thought about making an install function for this module to set the path in the system environment variable. Hoping this would make it easy to use for people to use. Plus with this helpful blog kind of telling you that as well, it should double down on the effort.
#
Invincible 🥚
Wow this is such an amazing comic. If you have not heard or seen it, please check it out. Such an awesome story-line and characters. Even Aamzon bought this as an animated series last year, so in massive respect to the Invincible Comic:-
#
Powershell World First 🗺️
I guess the thing that made me most happy about putting this altogether in the end, was that it is now a world first on the Powershell gallery:-
Wahoo!
#
All July'd out 😴
It's quite mad thinking this entire website has been smashed together in this month alone. Not only putting all these blogs together about something, but the blogs I have written about has been after work activity, as these have all been personal Powershell module projects for the greater good. None of this was planned, it's like it just all fell into place. Like I had no intentions of going right July 2022 show the world some of the stuff you can do after a full day in the office solving complicated issues. Show your creative side, show that you can build what-ever you want to build and make it work in Powershell. Again none of this was planned, I just happened to get inspired by a tweet Adam Driscoll did on Crescendo with the Sysinternals suite and I guess that was like giving me the information I needed to know to start doing some new modules based on existing command-line applications that there wasn't an equivalent of in Powershell. So I managed to stick 9 of my own personal projects onto the Powershell gallery and contribute to the Sysinternals Powershell module as well making it 10 modules I was involved in this month alone which are on the Powershell gallery. I also work a full-time job and have 4 daughters I come home to on a daily-basis and 2 Shar-Pei dogs who enjoy long walks. So again I guess feeling inspired by what others were doing things and how they were doing things, has led me to now being able to make Crescendo modules as well as Binary modules from C Sharp code. At first this all seemed a dark-art as not much is out there on the WWW on how to do this. I mean there is more stuff coming out for Crescendo, but the binary module seemed almost like a secret club you needed the password to get in on. However using the material I have posted in the initial blog was enough to get me started. Not everything has gone smoothly, but as these were personal projects there was no time-frame associated with getting the task done. Once I had completed my own first Crescendo module TShark followed by my first binary module ReadPDF things got flowing. I wasn't looking for new modules to build everyday, as I got enough to deal with when I walk through the door coming home from work. Again just was hoping if I put some half useful half crazy modules out-there in the public domain I might get a few more people noticing what I can do, and maybe following me on twitter or linkedin. This seems to be happening so things seem to be going to plan. I mean I am not super famous yet, or super rich, but those were not the plans for this website. Maybe it might lead to a hollywood movie, who knows (i don't think so) but nothing would of happened if I had not bothered this month. Bothered to read up on game changing Powershell techniques that can bring a whole new game to the modules you can release. So if you have not done so already get on youtube checking out these things I mentioned, as this now gives me a few different angles on how to approach a given problem. Like if you cannot do it in pure-Powershell but an old-skool cmd-line exe does then you can now make that into pure-Powershell by using Crescendo. Then as mentioned for my ReadPDF module, Powershell cannot read PDF encoding, it just comes out as whacky print on your screen. So I was able to use a C-Sharp library to do the hard work for me, and make that into a binary module, now allowing you to read a PDF file directly from Powershell. Remember you can find all the code associated with these modules on my Github repositories I have setup for them:-
#
That's all 👋
Top tip if you want to make a real picture not a cartoon one into ASCII, then I would strongly advise you open that picture up in MSPAINT. Press CTRL+A then right click and select INVERT COLOR it might make your picture look a bit weird but it seems to give much better results when showing the output. **Actually every picture you use looks better if you invert the picture first, through recent testing) I guess this is what I would look like made up of text 😁 Hopefully this blog has got you thinking what weird and wonderful things you could cook-up for Powershell. This blog has probably been one of my hardest to write, as my wife and I looked after my sister-in-law 1 year old baby for 2 days and nights, as my sister-in-law was giving birth, then when I returned their baby all my family got real sick. So did my in-laws. So like everyone was sick and it's been ages since I was sick like this, and well it just sucks. Thankfully I got an amazing wife who found out some kryptonite had somehow gotten into my house and that's what was making me ill. Look if you read this much massive respect. Go do something awesome!