Category: PoshBytes

PoshBytes

PoshBytes: Mastering Here-Strings in PowerShell

PoshBytes: Mastering Here-Strings in PowerShell Learn PowerShell here-strings the fast way with practical examples. We cover expandable vs literal, JSON without escaping, regex patterns, file generation, inline scripts, and how to stop your text from fighting back. This post is a companion for the video embedded below. Scroll down to see the code from the video. Expandable vs. Literal Here-Strings Setup...
PoshBytes

PoshBytes: Json Vs Csv

PoshBytes: Json Vs Csv In this PoshBytes Versus episode, ConvertTo-Csv and ConvertTo-Json go head to head to see which format handles your PowerShell data best. Learn how each manages types, nesting, and readability so you can choose the right tool for your next automation. This post is a companion for the video embedded below. Scroll down to see the code from...
PoshBytes

PoshBytes: Encrypting secrets with Protect-CmsMessage (without summoning eldritch IT beings)

PoshBytes: Encrypting secrets with Protect-CmsMessage (without summoning eldritch IT beings) Learn how to secure sensitive data in PowerShell using Protect-CmsMessage and Unprotect-CmsMessage. This PoshBytes episode covers how to encrypt, decrypt, and share secrets safely for real-world automation and configuration scenarios. This post is a companion for the video embedded below. Scroll down to see the code from the video. Create and...
PoshBytes

PoshBytes: Select-Object With Custom Properties (Because Plain Properties Are Boring)

Today on PoshBytes, we are going to look at creating custom properties right in the pipeline with Select-Object. This post is a companion for the video embedded below. Scroll down to see the code from the video. Watch the video on YouTube PoshBytes: Select-Object With Custom Properties (Because Plain Properties Are Boring) PoshBytes: Select-Object With Custom Properties (Because Plain Properties Are...
PoshBytes

PoshBytes: Copy, Paste, Automate!

In this episode of PoshBytes, we dive into the often-overlooked magic of PowerShell’s Get-Clipboard and Set-Clipboard cmdlets. This post is a companion for the video embedded below. Scroll down to see the code from the video. Watch the video on YouTube PoshBytes: Copy, Paste, Automate! This post walks through simple, practical clipboard operations in PowerShell. Each example includes a short summary...
PoshBytes

PoshBytes: Update-List

PoshBytes: Update-List The often forgotten, but always useful Update-List. This post is a companion for the video embedded below. Scroll down to see the code from the video. Create Sample Objects Define a helper function that returns a test server object with a Tags list, then create two copies for side-by-side comparisons. Function Get-TestSrv { param($n = 1) [pscustomobject]@{ Name =...
PoshBytes

PoshBytes: Arrays vs Lists

PoshBytes: Arrays vs. Lists What is the difference between Arrays and Lists, and SPOILER ALERT why you should use Lists. This post is a companion for the video embedded below. Scroll down to see the code from the video. Arrays: Creating and Appending Arrays have a fixed size. Using += creates a new array each time. $arr = 1,2,3 $arr $arr...