Welcome to PowerShell Junkie, a site dedicated to well, Microsoft Windows PowerShell. Thank you for visiting, my name is Imtiyaz Khan and I am a Windows System Admin by profession.
When i first saw what PowerShell could do, i immediately fell in love with it. and since then the thought to automate any and all tasks is always running in the back of my head.
How PowerShell came into my life and changed everything
Once upon a time, in one of my technical support jobs, i was tasked to troubleshoot computer issues for users in various regions of the world and the data was provided in an excel sheet with the users’ name, email and office location. Since these users were from different regions I was asked to schedule meetings during their work hours. While scheduling the meetings, some users replied stating they are in a different region than what was on my sheet. (Here we are, facing data inaccuracy,one of the common frustrations for most sys admins). To verify the data, I launched Outlook address book and started copy pasting into an excel sheet the name, email, title and office location for these users. My coworker saw that and he taught me an easier way to do it and that’s when I was first introduced to PowerShell, a scripting language that makes system administration a piece of cake. I sincerely thank him for that.
Like many other PowerShell enthusiasts, my first one liner code was
GET-ADUser -Identity “ikhan” -Properties Office | Select-Object Office
From there on i learned PowerShell by watching PowerShell 3.0 Jump Start and then loads of one liners were written for everyday tasks. Some of them matured into functions, some were just combined and some remained one liners like my first one liner.
Now that you know the history, this site is basically a repository for all scripts that I wrote and the scripts that I collected from the web. You will notice that most of the scripts are one liners or a combination of multiple one liners. I will add references and more context around the scripts as time permits but first i wanted to get them all out of my one drive and publish them here(github). You may also find some scripts to be funny and I do too because these are scripts I wrote in the very beginning when I first started learning PowerShell and while I am not very proud of them, I want new learners so know it’s OK to write stupid scripts and learn from your mistakes. Don’t try to be perfect the first time or you will focus too much in one area and won’t be able to expand on your potential skills. So, without further ado, browse away and I hope you find the scripts useful.