Building PowerShell Module - how to organise your source files and build with ease

Organising all files, scripts and functions required to build a module might give one a headache. PowerShell doesn’t come with native way of building the module, which doesn’t make our job easier. Hence, we’re going to use ModuleBuilder from PowerShell community so that the way we organise the code is predictable and used widely across other PowerShell projects. In this video I’ll walk you through the process of preparing, organising and finally building the module....

14 March 2022 · 1 min · 79 words · Kamil

PowerShell Module and Manifest- create and configure your tools

The more PowerShell code you write results in more and more scripts. Often you have multiple scripts managing one domain or application. What in situation when scripts start to use other scripts to work, creating so called dependency? PowerShell module is the answer - it’s the native way of bundling in multiple functions together as a single file. And the best comes with Module’s Manifest, a file that describes things like version of your module, requirements for it to run, author’s details etc....

23 February 2022 · 4 min · 828 words · Kamil

PowerShell Parameter Attributes - validate, group, require params and add pipeline to your function

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....

7 February 2022 · 5 min · 1034 words · Kamil

PowerShell function - converting script into function with parameters

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?...

21 January 2022 · 2 min · 371 words · Kamil

PowerShell for IT Professionals

Hi and welcome in the PowerShell for IT Professional course! The course is aimed at IT Professionals/system administrators that never coded before and manage Windows workloads. To get started all you need is a Windows machine (I’d recommended server edition run as VM), in the course you can see me explaining and using commands, thus I strongly encourage you to follow along with me. All the videos and related exercises are available for free and I am for each video to be 20-30 minutes long - thus you can easily find spare time to learn....

27 July 2020 · 2 min · 290 words · Kamil