Arrays and filters— Part 3

Please share this tutorial, that inspires me to continue doing this tutorial series.

Previous parts

Arrays

Before we can continue with the filtering we need to understand what arrays are in Powershell. Arrays are a collection of objects that you can iterate through to find something or organise a data structure. You can think of array like a basket of fruit and you can have multiple baskets, one for vegatables and one for fruits. If we take a look at how the structure of array is then you can see it is very simple

$basket = “apple”,”orange”,”banana”,”kiwi”

You can print out how many objects are in this example by using the count method which is available in all objects or you can also write out the specified object in specific index of the basket, as seen in the image below. …


Commenting and modules — Part 2

Please share this tutorial, that inspires me to continue doing this tutorial series.

Previous parts

You read part 1, and that is great, that means that you are interested in Powershell and would like to continue learning. There are a few things that are that you need to know when you are developing, so let’s get to this.

Commenting

When you are developing, it is good to have comments in the script, that would help you in the future to understand the script and also help others who read the script. It is pretty awkward when you created a script, and you did not write any comment, and you are trying to explain the script to someone and you can’t because you don’t know what is happening, so you have to spend the time to reread the code and try to understand this. Believe me that this is more common than you think. Comments are just like documenting the script; the person who is reading the script is like reading a book. So how do you comment, well it is important to know that even if you are commenting the code that you should have some structure for the comments and of course that you should also have some structure for the code and it is important to keep in mind that when you comment that you are not commenting something that is self explanatory, such as if you had a variable named my age, that is really self explanatory and should not necessary be commented. …


Image for post
Image for post
Working with Visual Studio Code on MacOS

Please share this tutorial, that inspires me to continue doing this tutorial series.

Beginners guide to Powershell — Part 1

This idea to teach Powershell was on top of my list, I started to write a book about Powershell and the title would be used as the primary name for the book. Anyhow, I’m just going to write a blog to help users get started in Powershell.

If you are an IT admin but don’t know how to write code or even start, well you are probably in the same situation as many IT admins are in. That being said, how do you start learning Powershell. Well, the first thing you should know what Powershell is and what it is used for. Powershell is mostly used for developing scripts to automate administrative tasks such as creating users, installing software, mapping drives or even install a whole environment with all the Windows features required to speed up development. …

About

Gisli Gudmundsson

IT tech geek, developer etc.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store