A new teacher and fun with PowerShell
Since my post about the chaotic lessons in IT retraining, something has changed: we actually got a new teacher. I think we’re all much happier now. Whether the current teacher is preparing us well for the exam is something I can't say for sure. My gut feeling is that the lessons are currently preparing us more for our future lives as application developers, and at least for me, some connections have been made in my mind that weren’t there before. So, I’m not complaining.
The new teacher loves Linux and the command line, no doubt about it. I think we’ve already spent two weeks in the Linux Bash, using a virtual machine that we set up together — more than one, more than once. Sometimes it gets a bit boring, but I’m keeping up just fine. I think I have a knack for this kind of thing. Not necessarily Linux itself, but as I’ve mentioned before, I enjoy working with Git — at a beginner level — and in general, I like terminals and typing in commands to see things happen.
When the teacher went off on a tangent again, I took some time to explore Windows PowerShell. After all, I have that on my home computer as well. I looked up a list of common commands online and just started experimenting.
After that, I had a question for ChatGPT: What other interesting or fun things can you do with PowerShell? The Star Wars animation thing seemed a bit sketchy, so I didn’t try it, but I did manage to display the weather.
ChatGPT also taught me how to start a program from PowerShell using Start-Process
. I don’t remember whether it was before or after that when I also learned that I could write a function. I had to try it right away and wrote the weather report command inside a function, calling it HowsTheWeather
.
Function HowsTheWeather {
Invoke-RestMethod -Uri "https://wttr.in/?format=3"
}
Then I thought: “Oh yeah, there was this guy on YouTube who talked about scripting things to make life easier.”
So next, I tried writing a function that opens everything I usually open when I work on my website. And it actually worked!
I know this might be basic stuff for some people and nothing special, but for me, it was a little success that made me happy. Now, I want to try all of this — and hopefully more — on my own computer at home!
====================
REPLY VIA E-MAIL
====================
>>> Music: -
>>> Mood: fine
----------