The PowerShell Collection

Skip to Videos
  • Running PowerShell code  as background tasks with PowerShell jobs
    2/9/24

    Running PowerShell code as background tasks with PowerShell jobs

    Explore the essentials of PowerShell Background Jobs and Scheduled Tasks in our comprehensive tutorial. This video is designed to equip you with the knowledge to automate and schedule tasks efficiently using PowerShell, enhancing your productivity and system management skills. From setting up background jobs for asynchronous processing to scheduling scripts for optimal execution, we cover key techniques and best practices. Whether you're new to PowerShell or looking to refine your existing skills, this guide provides valuable insights for effective task automation and scheduling. Join us to deepen your understanding of PowerShell's capabilities and improve your workflow

  • Getting Started with Powershell - Running you first code
    10/29/21

    Getting Started with Powershell - Running you first code

    Welcome to the "Getting Started with PowerShell" video series, designed to teach you the fundamentals of PowerShell and help you build a solid foundation in this powerful tool.

    In this first video, we will cover the basics of PowerShell, including what it is, why it's important, and how to get started with it. You'll learn how to install PowerShell, navigate its interface, and use basic commands to perform simple tasks. We'll also explore the differences between PowerShell 5 and PowerShell 7 and help you choose the right version for your needs.

    Whether you're a beginner or an experienced IT professional, this series is for you. We'll cover a wide range of topics, including scripting, automation, advanced functions, and more. By the end of this series, you'll have a strong understanding of PowerShell and how to use it to streamline your work and boost your productivity.

    So join us for this exciting journey into the world of PowerShell. Be sure to subscribe to our channel and hit the notification bell to stay updated on future videos in this series. Let's get started!

    PowerShell 5 is the version of PowerShell that was released with Windows 10 and Windows Server 2016, while PowerShell 7 is a cross-platform version of PowerShell that can run on Windows, Linux, and macOS. PowerShell 7 includes new features and improvements over PowerShell 5, including enhanced performance, new language features, and compatibility with more modules.

    The best way to get started with PowerShell is to first learn the basics of the language, such as how to use cmdlets, variables, and control structures. You can then start exploring more advanced topics such as scripting, functions, and modules.

  • The Art of Handling PowerShell Variables: Exploring Strings, Integers, Hashes, and Arrays
    10/29/21

    The Art of Handling PowerShell Variables: Exploring Strings, Integers, Hashes, and Arrays

    In PowerShell, variables are used to store data values that can be referenced and manipulated throughout a script or a session. Here's how variables work in PowerShell:

    Defining a Variable: To create a variable, you need to use the "$" sign followed by the variable name, an equal sign "=", and then the value you want to assign to the variable. For example, to create a variable called "name" and assign it the value "John", you would use the following command:

    $name = "John"

    Using a Variable: Once you have created a variable, you can reference it by typing its name preceded by the "$" sign. For example, to display the value of the "name" variable, you would use the following command:

    Write-Host $name

    This would output the value "John" to the console.

    Modifying a Variable: You can also modify the value of a variable at any time by simply assigning a new value to it. For example, to change the value of the "name" variable to "Jane", you would use the following command:

    $name = "Jane"

    Variable Scope: Variables in PowerShell can have different scopes, which determine where they can be accessed from. There are several types of variable scopes, including:

    Global: A global variable can be accessed from anywhere in the script or session.

    Script: A script variable can only be accessed within the current script.

    Local: A local variable can only be accessed within the current function or script block.

    You can define the scope of a variable by using the appropriate keyword when defining the variable. For example, to define a global variable, you would use the following command:

    $global:name = "John"

    This would create a variable called "name" with global scope, which could be accessed from anywhere in the script or session.

    Overall, variables in PowerShell are an essential tool for storing and manipulating data values, and understanding how to use them effectively is a key part of writing PowerShell scripts.

  • Discover the Secrets of PowerShell Help: Get-Help & Get-Alias Uncovered"
    10/18/21

    Discover the Secrets of PowerShell Help: Get-Help & Get-Alias Uncovered"

    Get-Help and Get-Alias are two important PowerShell cmdlets that help users navigate and utilize the PowerShell environment. Here's a brief overview of each:

    Get-Help: This cmdlet allows users to access documentation and help files for PowerShell cmdlets, functions, and modules. To use Get-Help, simply type the cmdlet name followed by the -? or -help parameter. For example, to access help for the Get-ChildItem cmdlet, type the following command:

    Get-Help Get-ChildItem -?

    This will display a detailed help page for the Get-ChildItem cmdlet, including information on its syntax, parameters, and examples of how to use it.

    Get-Help also includes several other parameters that allow users to refine their search for help information, such as -Detailed, -Examples, -Full, and -Online.

    Get-Alias: This cmdlet allows users to view and manage aliases in PowerShell. An alias is a shorthand or alternate name for a PowerShell cmdlet, function, or script. To use Get-Alias, simply type the cmdlet name followed by the -Name parameter and the name of the alias you want to view. For example, to view the alias for the Get-ChildItem cmdlet, type the following command:

    Get-Alias -Name gci

    This will display the alias name and the command it represents, which in this case is Get-ChildItem.

    Get-Alias also includes several other parameters that allow users to view and manage aliases, such as -Definition, -Description, -Exclude, -Include, and -UnaliasedFunction.

    In summary, Get-Help and Get-Alias are two powerful cmdlets that can help users access and manage PowerShell cmdlets, functions, and aliases. They are useful tools for anyone working with PowerShell, and can help users save time and increase productivity by providing quick access to important information and commands.

    Featured playlist

  • PowerShell Functions begin with the basics
    10/18/21

    PowerShell Functions begin with the basics

    PowerShell functions are reusable code blocks that allow you to group a set of PowerShell commands together and execute them as a single unit. Functions are a fundamental building block of PowerShell scripts and are useful for reducing code duplication, improving code organization, and making your scripts more modular and maintainable. Here's how PowerShell functions work:

    Defining a function: To create a function in PowerShell, you use the function keyword followed by the name of the function, a set of parentheses, and a set of curly braces. Inside the curly braces, you can include any number of PowerShell commands that you want the function to execute. For example, here is a simple function called HelloWorld that outputs the message "Hello, World!" to the console:

    function HelloWorld {

    Write-Host "Hello, World!"

    }

    Invoking a function: Once you have defined a function, you can invoke it by typing its name followed by a set of parentheses. For example, to invoke the HelloWorld function from the previous example, you would use the following command:

    HelloWorld

    This would output the message "Hello, World!" to the console.

    Passing parameters to a function: Functions in PowerShell can also accept parameters, which are values that are passed to the function when it is invoked. To define a function with parameters, you include the parameter names inside the parentheses when defining the function, like this:

    function Greet($name) {

    Write-Host "Hello, $name!"

    }

    In this example, the Greet function accepts a single parameter called $name. When the function is invoked, you pass a value for the $name parameter, like this:

    Greet "John"

    This would output the message "Hello, John!" to the console.

    Returning values from a function: Functions in PowerShell can also return values, which can be used in other parts of your script. To return a value from a function, you use the return keyword followed by the value you want to return. For example, here is a function called Add that adds two numbers and returns the result:

    function Add($a, $b) {

    return $a + $b

    }

    To use the Add function and capture its return value, you can assign the function call to a variable, like this:

    $result = Add 2 3

    Write-Host "The result is $result"

    This would output the message "The result is 5" to the console.

    Overall, PowerShell functions are a powerful tool for building modular, reusable code in your scripts. They allow you to encapsulate complex logic and functionality, and make your code more organized, maintainable, and reusable.

  • Step-by-Step: Building & Leveraging PowerShell Modules with PSGallery
    10/18/21

    Step-by-Step: Building & Leveraging PowerShell Modules with PSGallery

    PowerShell modules are a way to package and distribute reusable sets of PowerShell code, functions, cmdlets, and scripts that can be easily imported and used in other PowerShell scripts or sessions. Modules help improve the organization and maintenance of PowerShell code by encapsulating related functionality in a single unit that can be loaded or unloaded as needed.

    PowerShell modules typically consist of a manifest file (.psd1) that describes the module and its dependencies, one or more PowerShell script files (.psm1) that contain the module's functions and cmdlets, and possibly other resource files such as help files or configuration files. Modules can also include version information, author information, and other metadata that can help users understand and use the module.

    To use a PowerShell module, you first need to import it into your PowerShell session using the Import-Module cmdlet. Once the module is imported, its functions and cmdlets become available for use in your scripts or interactive sessions.

    The PowerShell Gallery (PSGallery) is a public repository of PowerShell modules, scripts, and DSC resources maintained by Microsoft. It provides a centralized location for PowerShell users to discover and download community-contributed modules and scripts, as well as Microsoft-provided modules such as Azure modules, SQL Server modules, and Exchange modules. The PSGallery can be accessed using the PowerShellGet module, which is included in PowerShell version 5.0 and later, and can be installed on earlier versions. The PSGallery is a valuable resource for PowerShell users looking to save time and effort by leveraging existing PowerShell code and functionality.

  • Beginner-friendly tutorial on PowerShell remoting
    10/18/21

    Beginner-friendly tutorial on PowerShell remoting

    Welcome to our beginner-friendly tutorial on PowerShell remoting! In this video, we'll introduce you to two essential cmdlets: Invoke-Command and Enter-PSSession, which will open up a whole new world of remote administration possibilities.

    With Invoke-Command, you'll learn how to execute commands and scripts on remote machines effortlessly. We'll walk you through the basics of targeting specific computers or groups, passing parameters, and retrieving results. This cmdlet is a fantastic tool for automating tasks across multiple machines without leaving your desk!

    Next, we'll explore Enter-PSSession, a command that allows you to interactively manage remote machines. Step into the remote machine's environment and gain real-time control, as if you were sitting in front of it. You'll discover how to navigate file systems, run commands, and manage remote sessions with ease.

    Throughout the tutorial, we'll provide practical examples and tips to ensure you grasp the fundamental concepts of PowerShell remoting. By the end, you'll have a solid foundation to start leveraging these powerful cmdlets for basic remote administration tasks.

    Whether you're new to PowerShell or have some experience, this tutorial is designed to give you a strong introduction to remoting. So grab your coffee, sit back, and get ready to enhance your productivity by harnessing the power of PowerShell remoting with Invoke-Command and Enter-PSSession. Let's dive in and unlock the possibilities of remote administration!

    Featured playlist

  • Beginner-friendly tutorial on PowerShell remoting
    10/18/21

    Beginner-friendly tutorial on PowerShell remoting

    Welcome to our beginner-friendly tutorial on PowerShell remoting! In this video, we'll introduce you to two essential cmdlets: Invoke-Command and Enter-PSSession, which will open up a whole new world of remote administration possibilities.

    With Invoke-Command, you'll learn how to execute commands and scripts on remote machines effortlessly. We'll walk you through the basics of targeting specific computers or groups, passing parameters, and retrieving results. This cmdlet is a fantastic tool for automating tasks across multiple machines without leaving your desk!

    Next, we'll explore Enter-PSSession, a command that allows you to interactively manage remote machines. Step into the remote machine's environment and gain real-time control, as if you were sitting in front of it. You'll discover how to navigate file systems, run commands, and manage remote sessions with ease.

    Throughout the tutorial, we'll provide practical examples and tips to ensure you grasp the fundamental concepts of PowerShell remoting. By the end, you'll have a solid foundation to start leveraging these powerful cmdlets for basic remote administration tasks.

    Whether you're new to PowerShell or have some experience, this tutorial is designed to give you a strong introduction to remoting. So grab your coffee, sit back, and get ready to enhance your productivity by harnessing the power of PowerShell remoting with Invoke-Command and Enter-PSSession. Let's dive in and unlock the possibilities of remote administration!

  • Error handling in PowerShell and explore the powerful `try`/`catch`/`finally` blocks.
    11/17/21

    Error handling in PowerShell and explore the powerful `try`/`catch`/`finally` blocks.

    In this informative video, I delve into the world of error handling in PowerShell and explore the powerful `try`/`catch`/`finally` blocks.

    When writing PowerShell scripts, encountering errors is inevitable. However, with the right techniques, I can gracefully handle exceptions and control the flow of my script.

    Join me as I demystify the concept of error handling in PowerShell. I will explain the fundamental components of the `try`/`catch`/`finally` construct.

    The `try` block is where I enclose the code that may generate an exception. PowerShell diligently monitors the code within the `try` block for any exceptions that may occur during its execution.

    Once an exception is detected, PowerShell immediately jumps to the corresponding `catch` block, allowing me to handle the error appropriately. I can have multiple `catch` blocks to handle different types of exceptions, ensuring precise and tailored error handling.

    But what about the `finally` block? This optional component allows me to specify code that will execute regardless of whether an exception occurred or not. It's the perfect place to perform cleanup tasks or execute critical code that should always run.

    In my practical example, I showcase a scenario where a division by zero occurs, triggering an exception. You'll see how the `try`/`catch`/`finally` blocks come together to handle the error gracefully.

    Throughout the video, I provide clear and concise explanations, ensuring that you grasp the concepts behind error handling in PowerShell. By the end, you'll be equipped with the knowledge to confidently implement these blocks in your scripts.

    Join me on this journey to master error handling in PowerShell and enhance the stability and reliability of your scripts. Don't let exceptions halt your progress – learn to handle them like a pro with `try`/`catch`/`finally` blocks!

    Whether you're a beginner PowerShell user or an experienced scripter, this video will empower you with the tools to handle errors effectively and take your PowerShell skills to the next level.

    Subscribe now and become a PowerShell error-handling expert!

  • Introduction into PowerShell Pipelines, Calculated Properties, and Formatting Output
    11/17/21

    Introduction into PowerShell Pipelines, Calculated Properties, and Formatting Output

    Welcome to our comprehensive tutorial on PowerShell Pipelines, Calculated Properties, and Formatting Output! In this video, we'll explore how PowerShell Pipelines can be enhanced with calculated properties and different formatting techniques to make your output more visually appealing and informative.

    First, we'll dive into PowerShell Pipelines, understanding how they allow you to chain commands together and pass data seamlessly. Then, we'll introduce calculated properties, a powerful feature that enables you to perform calculations on-the-fly within your pipelines. You'll learn how to manipulate and transform data using expressions, variables, and operators, all while keeping your code concise and efficient.

    Next, we'll explore various formatting options available in PowerShell. We'll demonstrate how to use the `Format-Table`, `Format-List`, and `Out-GridView` commands to present your data in tabular, list, and interactive grid views respectively. You'll discover how to customize column widths, select specific properties to display, and add sorting and grouping to your formatted output.

    Finally, we'll introduce you to the `PowerShell -f` function with `{0:N2}` format specifier. This powerful combination allows you to format numeric values with two decimal places, providing clean and consistent output for financial or statistical data.

    Whether you're a PowerShell beginner or seasoned user, this tutorial will equip you with the knowledge and skills to take your PowerShell pipelines to the next level. Make sure to like this video, subscribe to our channel, and hit the bell icon to stay updated with more insightful tutorials. Feel free to leave your questions and comments below—we're here to help you excel in PowerShell scripting.

    Tags:

    PowerShell Pipelines, Calculated Properties, Formatting PowerShell Output, Out-GridView, Format-Table, Format-List, PowerShell -f function, PowerShell scripting, PowerShell tutorial, PowerShell commands, PowerShell automation, PowerShell scripting tutorial, PowerShell for beginners, PowerShell tips and tricks, PowerShell scripting techniques, PowerShell productivity, PowerShell scripting best practices, scripting workflow, PowerShell automation tutorial

  • Starting out with Powershell in the multiverse! Multi Dimensional Arrays
    11/17/21

    Starting out with Powershell in the multiverse! Multi Dimensional Arrays

    In this YouTube video, we dive into the world of PowerShell arrays, covering a wide range of topics related to data storage and manipulation. Whether you're a beginner or an experienced PowerShell user, this comprehensive guide will provide valuable insights into working with arrays, hash tables, and the System.Collections.ArrayList class.

    We start by exploring 1-dimensional arrays, learning how to create, access, and modify elements using different techniques. Discover useful tips and tricks for iterating over array elements efficiently and gain a deeper understanding of PowerShell's indexing system.

    Next, we venture into the realm of 2-dimensional arrays, unlocking their power to store and organize data in a tabular format. Follow along with practical examples that demonstrate how to access specific values and manipulate rows and columns effectively.

    Hash tables are another essential data structure we cover in this video. Learn how to associate values with unique keys, allowing for fast and efficient data retrieval. Explore techniques for adding, removing, and updating key-value pairs within hash tables.

    Lastly, we delve into the dynamic nature of the System.Collections.ArrayList class. Witness its ability to dynamically grow and shrink as elements are added or removed, providing flexibility in handling varying data sets. Discover how to leverage ArrayList's methods for insertion, deletion, and iteration to enhance your scripting capabilities.

    Throughout the video, we share best practices, performance tips, and real-world examples to help you apply these concepts effectively in your PowerShell scripts. Whether you're managing large datasets, performing data analysis, or building complex automation workflows, understanding PowerShell arrays is crucial for mastering PowerShell scripting.

    Join us on this journey into PowerShell arrays, and unlock the full potential of data storage and manipulation in your PowerShell scripts. Don't miss out on this comprehensive guide that will empower you to become a proficient PowerShell array ninja!

    Remember to like, comment, and subscribe to our channel for more PowerShell tutorials and tips. Get ready to supercharge your scripting skills with PowerShell arrays!