PowerShell functions are very robust with several features that greatly improves the way users interact with them. One important feature that is often overlooked is -WhatIf
and -Confirm
support and it is easy to add to your functions. In this article, we will dive deep into how to implement this feature.
Powershell: How to Disable SMBv3 Compression
If you are working on the ADV200005 Security Advisory for CVE-2020-0796, the primary workaround is to disable SMB Compression on the host. Let’s take a look at how to do that in the registry with PowerShell.
[Read More]Powershell: Everything you wanted to know about the IF statement
Like many other languages, PowerShell has statements for conditionally executing code in your scripts. One of those statements is the if statement. Today we will take a deep dive into one of the most fundamental commands in PowerShell.
[Read More]Powershell: Building Micro Modules
I am a big fan of modules as a way to package and distribute PowerShell functions. I create modules all the time and I tend to use a fairly robust set of build and release scripts. More recently, I have wanted to release an individual advanced function as a module but I felt that my existing process was a bit much. So I started building micro modules instead.
[Read More]Powershell: Jira module project
Let me tell you about a Jira module that I have been building over the last two weeks. I have been thinking about creating my own module for a while now. After talking about my idea after a recent PowerShell user group, I was given a lot of positive feedback on the idea. So I decided to jump in and write it.
To set the stage here, I work with the JiraPS quite a bit. Our development cycle has deeply integrated Jira into the workflow so we have quite a bit of automation around Jira issues. There are times that we push JiraPS harder than it was intended to be pushed.
[Read More]What happened to kevinmarquette.github.io?
I wanted to let all my regular readers know that kevinmarquette.gitub.io
has moved to powershellexplained.com. This is still the same site you were using before with all the same content under a new name.
2018: What have you done with PowerShell this year?
Over on /r/PowerShell, we share with each other everything that we have done with PowerShell every month and reflect on that at the end of the year. This has been a big year for me. Not only have I been able to work on some great projects professionally, I also received a lot of recognition this year for my community efforts. As I reflect back on this year, I accomplished way more than I expected.
[Read More]Powershell: Everything you wanted to know about $null
The PowerShell $null
often appears to be simple but it has a lot of nuances. Let’s take a close look at $null
so you know what happens when you unexpectedly run into a $null
value.
PowerShell and DevOps Global Summit 2019
The PowerShell and DevOps Global Summit 2019 is one of the largest gatherings of the PowerShell community. Not only is this conference packed full of sessions, it also gives you a chance to connect with many people from the community. This is a conference that has something for everyone.
[Read More]Powershell: Everything you wanted to know about arrays
Arrays are a fundamental language feature of most programming languages. They are a collection of values or objects and are therefore, difficult to avoid. Let’s take a close look at arrays and everything they have to offer.
[Read More]Powershell: Building Modules with the Azure DevOps Pipeline
Microsoft just released a new Azure DevOps service offering called Azure Pipleines that is free for open source projects. I decided to check it out by moving my PSGraph build and release pipeline over to Azure Pipelines.
[Read More]Powershell: DependsOn Module
One nice feature of a DSC configuration is that all resources support specifying a DependsOn
property that ensures that the resources that it depends on are ran first. Every once in a while, I find myself wanting to use that feature in other scripts. I created a module called DependsOn to do that for me.
Powershell: How to create a Standard Library Binary Module
I recenty had an idea for module that I wanted to implement as a binary module. I have yet to create one using the PowerShell Standard Library so this felt like a good opportunity. I was able to use the Creating a cross-platform binary module guide to create this module without any roadblocks. We are going to walk that same process and I’ll add a little extra commentary along the way.
[Read More]Powershell: Generating random data with NameIT
I find that I often need random datasets for testing or for examples in my presentations. My favorite tool for that is NameIT. This is a PowerShell module written by Doug Finke that makes it super easy to create good looking but random data.
PS:> Invoke-Generate '[person]' -Count 3
Heather Rogers
John Bailey
Julia Perez
Powershell: ConvertTo-Breakpoint
I was just at the PowerShell and DevOps Summit last week. It was great to meet so many of the people that I have worked with online. I also walked way with several ideas that I wanted to work on.
One idea came to me while sitting in Kirk Munro’s session on debugging. I was writing a lot of notes and reflecting on how I was debugging my scripts. Then I realized I could make a simple function to make it easier.
[Read More]