PowerShell Tutorial 4 : Hashtables & Custom Objects [Beginners]

preview_player
Показать описание
In this video we take a look at Powershell hashtables and custom objects and how we can use them to store our data.

In the next video we will be taking concepts from the first 4 videos and combining with what's called the pipeline.

Tags:
-PowerShell
-Hashtables
-Datastructures
-Programming
-Scripting
Рекомендации по теме
Комментарии
Автор

Been doing powershell for 10 years, switching from custom objects to hash tables for large datasets in the last year and a half has led to such wild increases in performance as much as 6x. Kind of crazy seeing it in action cause you almost think you broke something

Akira_
Автор

Hello 👋. Excellent videos (I’ve seen two so far and both are excellent!). May I suggest to zoom in often on the code, so it can be seen better? Sometimes One sees the videos in a phone and the text code is too small for that screen size…

lautarob
Автор

Excellent, all videos should be like that..

OurstPlanet
Автор

I'm trying to create a script that uses a hashtable to store something like $flashdrive = Get-Disk | Where-Get ($. _bustype -eq 'removable' ) and $usbvolume = Get-Volume | Where-Get ($._partitionstyle -eq 'fat'). If both those values could be contained in a hash, with a set key that is iterative, the key could be referenced later in commands regarding remove-partition, and then new-partition, and then format the drives to efi Fat with an allocation of 32678, but it always returns an error that claims it can't find a valid parameter for volume, idk what else to try
Edit : I should clarify that the code to input automatically into the table I have, and I'm trying to store something like UniqueID linked to drive type Fat, with per drive confirmation of changes so that when the command iterates it will see a uniqueID already exists in the table and move on. The keys would be input as drives are completed ideally but I'm a lost noob haha

Dopeykid
Автор

Nice! How would you pass PSCustomObject to a function as parameter?

freshmakero