About PowerShell is educational series of videos that teach you about different aspects of PowerShell usage.
All the code is available on GitHub.
About PowerShell is educational series of videos that teach you about different aspects of PowerShell usage.
All the code is available on GitHub.
Having properly configured parameters help your users to understand the use of your function. It also helps fellow developers to appreciate the intended use of the function. In addition, it gives you more control of how the code flows through your script. Parameter attributes is what takes parameters to the next level - you can specify that certain parameters are mandatory, group them together so that only certain combination of parameters is meant to work together, we can even add pipeline support so that function can be used as any other built-in function....
So you’ve been writing your scripts for some time and wondering how to make them more PowerShell-like, so that they can be invoked from the console like all the other cmdlets? In this quick video I’ll show you how to convert a sample script into function, add parameters and indicated to your user how to use your function with mandatory parameters and types. # Sample script which asks user for basic information, then manipulates it and # display some information # There's no way (at least easy) to pass these parameters from prompt, nor validate $Name = Read-Host -Prompt "What's your name?...
Everything is an object in PowerShell, and ability to create own object allows for one more way of controlling and handling data. In this video I’ll take you through the steps of creating PSCustomObject, working with its properties to doing more advanced topics - like adding methods and types to the object. <#PSScriptInfo .VERSION 1.0.0 .GUID f5228c81-d25c-4984-bb0c-e64576487b3e .AUTHOR Kamil Procyszyn .COPYRIGHT Kamil Procyszyn .PROJECTURI https://github.com/kprocyszyn/About-PowerShell .RELEASENOTES 2021 November .DESCRIPTION Link to the video: https://youtu....
Quick crash course into using hash tables in PowerShell. <#PSScriptInfo .VERSION 1.0.0 .GUID 50fa84c4-080d-45cd-82a8-9e8dba10b187 .AUTHOR Kamil Procyszyn .COPYRIGHT Kamil Procyszyn .PROJECTURI https://github.com/kprocyszyn/About-PowerShell .RELEASENOTES 2021 September .DESCRIPTION Link to the video: https://youtu.be/oti2l8EmAT8 Documentation: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_hash_tables?view=powershell-7.1#:~:text=In%20PowerShell%2C%20each%20hash%20table%20is%20a%20Hashtable,to%20create%20an%20ordered%20dictionary%20%28System.Collections.Specialized.OrderedDictionary%29%20in%20PowerShell. #> <# About hashtable: A hash table, also known as a dictionary or associative array, is a compact data structure that stores one or more key/value pairs. For example, a hash table might contain a series of IP addresses and computer names, where the IP addresses are the keys and the computer names are the values, or vice versa....
Array is a basic data structure that allows to store multiple items in one variable. In this short video, I’ll show you how to create a basic array, populate it with items, how to add, access and modify items within array. In addition, I’ll present to you how to use ArrayList - which is much more flexible array, especially for adding more items. # Link to the video: https://youtu.be/rvGd8kxXlVc # What is an array and why do I need it?...