MENU

Fun & Interesting

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

ABMedia 22,900 lượt xem 3 years ago
Video Not Working? Fix It Now

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 CSV file I used ►https://abco.live/download/2021/students.csv

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:

Website ► https://abco.live/
Discord ► https://abco.live/discord

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

Comment