Learn PowerShell: Episode 3, Variables + NoteProperties + CSV Files

preview_player
Показать описание
In this video we take our knowledge of PowerShell even further, using "NoteProperty" to make custom properties, using "variables" to hold onto objects and read/writing to CSV files, and much more! All coming up, in this new episode of the beginners' PowerShell tutorial series.

The video starts with variables, a critical tool we can use to help us get things done easier. It allows us to hold onto objects so we can continually re-use them again and again, letting us write shorter, more concise commands. In addition, this mechanism of holding onto objects allows us to take full advantage of our system. Reducing CPU usage and memory usage, just from such a simple construct.

We'll then look at an extremely powerful and simple command called "Import-Csv", which allows you to take any CSV file and immediately read it into objects that you can then operate on and work with.

After that, we'll use what we learnt from using "Import-Csv" in order to help us investigate converting from one kind of data to another. We'll learn about what the difference between text and numbers are to the computer, as well as how to go from one to the another within PowerShell, as well as what CSV's fundamental flaw is when it comes to different types of data.

Next, we'll take a look a "NoteProperty". This is an extremely useful type of member you can get on an object that allows you to attach your own custom property to any object you want. Allowing you to work in an even more detailed and systematic way.

We'll then use these "NoteProperty"s alongside a command called "Export-Csv" to help us modify the CSV and add a new column. Filling this column with values, adding numbers, and viewing these note properties will all be made clear in the video.

PS: This episode was also the first one on the entire channel to be edited 100% within the video editor. Previously, the videos were edited using a combination of two programs:

- The video editor for editing the audio, cutting up the screen recording footage, adjusting the audio levels etc.
- The graphics program used to create all the animated sequences and graphics.

The graphics produced by the graphics program were then edited into the video through the editor, and timed up with the audio and screen recording, allowing it to all be seen as one single video.

However, this video is a new step in the evolution of ABMedia in that it doesn't use the graphics program at all! Everything seen in this video was created directly from the video editor. This new style of producing the videos should allow for a quicker production time (after some setting up time is allowed to fully set up all the presets properly for it), and it should hopefully in the future allow the graphics seen throughout the video to get even more involved in the actual screen recording footage, allowing all kinds of new views and an even more coherent flow than was ever possible before with the static images present in the graphics previously.

This shouldn't affect the visual quality of the series at all. As a matter of fact, the graphics in the video look almost identical to the previous one, it's just a specific detail of exactly how it's now being done behind the scenes - and a new step in the right direction for ABMedia's development as a high-quality, well-edited brand of videos.

Thank you for your support of ABMedia. Just by watching and enjoying these videos, you are helping out immensely in supporting the channel and its development. Thank you very much for reading this description too, all videos have detailed descriptions, thumbnails, subtitles and content to try and allow the highest accessibility and surrounding content as possible.

Chapters:

0:00 Variables
6:38 CSV Files
9:48 Casting
12:52 NoteProperties
16:40 Custom Properties
19:43 Putting It Together

Thanks for watching my video, before are some general ABMedia links if you are interested:

The Discord server is a place to chat with the creator of this video, as well as anyone who contributed to its development and has helped support ABWorld over the years.

A huge thank you goes to @ndumiphotos (on Instagram) for the graphics used in the intro.

#learnpowershell #powershell
Рекомендации по теме
Комментарии
Автор

4 Years ago still relevant! Thanks man! I've learned a lot from you!

robinkenway
Автор

These tutorials are probably the best I have come across. The presenter has natural expression and emphasis which makes the lessons feel personal. His typing is excellent without errors and constant corrections.

lewishamilton
Автор

Without a doubt one of the best Powershell instructional series out there. Many, many thanks.

paulgriffin
Автор

Wow, thank you so much for the natural way of explaining things in Powershell! Very clear, concise and memorable!

StellaCobb-dx
Автор

11:10 "You are learning stuff that applies to full on programming languages in this series". Exactly why I'm here :) Thanks, this is awesome! Edit: Was not expecting that extremely cool NoteProperty technique at the end, that's epic!

MunnyLerner
Автор

The first course that makes actually enjoyable learning PS. You are a talented teacher, my friend!

sinestesiagarcia
Автор

These videos deserve more likes and views, keep up the good work!

GraysonSedory
Автор

Episode 4 is just a week away! Get excited... Maybe!

ABCo-ABMedia
Автор

Great video course! So glad I discovered it. You have a great way of explaining things.

BarrySwords
Автор

Amazing Series!!! love it! Thank you so much for making such a great content!

kalpitkatpara
Автор

Excellent. I like it a lot. You are a great teacher. See you in the next video!

taulguedi
Автор

thank you so much! you made powershell easily to learn ^^

kaivoyage
Автор

Hey Alex ! Thank you very much for these wonderful videos, 1st time ever i finally get what's going on so far and nice speechflow. However, im stuck with this bloody csv file because i can't figure out how you formated your file to get PS recognize that the first line are properties of each column we can next apply function [int], measure and so on.
I'm wondering then how did you formated you csv file from excel ? So far i'm getting semicolon delimiter for each values but what bothers me the most is that my first line (4 words > 4 properties > 4 columns) is underlined by one continuous line and yours is nicely separated so i assume PS recognize in your file how to separate values. What's the secret?

Adnan_Laghzaoui
Автор

Best video series ever for PS on YouTube, Legendry to be fair

zeelpatel
Автор

An easier way to cd where you want to go is to grab the file or dir and drop it into Powershell and it will auto-fill the correct path

jasonmoore
Автор

Hello,
Im really enjoying these videos, but i have two problems

1.When i type $students = Import-Csv -Path 'test.csv', i get the following error,

Import-Csv could not find the file in 'C :\Users`\Barry\test.csv'
I downloaded your file and saved it in documents, in notepad...

2....11:27 on your video
When i write out the maths part, i get this error,

Invalid Operation.The property 'Maths' cannot be found on this object.Verify that the object exists and can be set

Sorry if this sounds really basic, but im new to powershell and scripting in general..Im using these videos to put on my CV, as im looking for an entry level job in I.T

barry
Автор

These are great, sad to see you stopped

xdasdaasdasd
Автор

Your videos are brilliant. I am just wondering why you have not upload anymore. Could you please share your knowledge its quiet helpful.

discopunjabi
Автор

Thank you for such an outstanding and easy to understand explanation of why Import-Csv doesn't properly assign things like numbers as integers, which also carries over to dates (which need to be casted to [datetime])

kiltsandcomputers
Автор

생성된 object에 원하는 property를 하나 더 넣을 수 있는지 몰랐었네요 ^^
좋은 정보 감사합니다.
노마드코더 니꼴라스님 목소리 같은데 맞나요?

honsok
welcome to shbcf.ru