Linked: Powershell PSDefaultParameterValues

A deep dive into PowerShell parameter defaults

2021-03-27 · 1 min · Marco Kamner

The Null-Coalescing Operator

Today we take a closer look at the null-coalescing operator and how it can help us in writing smarter, more concise scripts. PS> $userDate ?? (Get-Date -Format "yyyy-MM-dd") 2021-02-14 PS> $userDate = Get-Date -Year 2020 -Format "yyyy-MM-dd" PS> $userDate ?? (Get-Date -Format "yyyy-MM-dd") 2020-02-14 How it works We can write some simple code to visualize what the null-coalescing operator is doing function nullCoalescingOperator ($leftValue, $rightValue) { if ($null -eq $leftValue) { return $rightValue } else { return $leftValue } } Usually we will want to assign the resulting value to a variable....

2021-03-22 · 2 min · Marco Kamner

Filter Arrays

Filter arrays in PowerShell

2021-02-27 · 1 min · Marco Kamner

Delete Your Old VMware Snapshots

For the love of Pete, please delete your old snapshots regularly! Old snapshots have caused incidents and even outages more than once in my career and it is really easy to preemptively look for them and get them removed before anything happens. Why To put it plainly, they can cause issues - like 03:00 in the morning pager alert issues and additionally eat up storage space like crazy. Degraded performance of the VM having the snapshot Degraded performance to full outages for other VMs on the same data store due to rapidly increasing snapshot sizes VMware recommends a series of steps to reduce risk when using snapshots:...

2021-01-01 · 3 min · Marco Kamner

Show vCenter On VM Object

Show vCenter on VMs in PowerCLI with this custom property

2021-01-01 · 1 min · Marco Kamner

How To Find With PowerShell

Finding files, do I even need to describe how important this is?

2020-12-31 · 5 min · Marco Kamner

Super-Charged Cmdlet Aliases

It works like magic, but it works - Bring your aliasing to a whole other level!

2020-12-02 · 4 min · Marco Kamner

Linked: Powershell Aliasing

A deep dive into aliasing with PowerShell

2020-12-02 · 1 min · Marco Kamner

Why You Want To Install PowerShell On Windows

Why installing PowerShell on Windows may actually be a good idea

2020-11-28 · 2 min · Marco Kamner

Collections and Randomization

Randomize Collections in PowerShell

2020-11-18 · 2 min · Marco Kamner