PowerShell DSC: Self Signed SSL Certs

Hello! First, this isn't a best practices guide for SSL certificates, it's a how-to for creating functional ones. As always, only use self-signed certs when you've specifically validated that they're a sufficiently secure solution. When I do need self-signed certs and I'm working in Windows, I generate them with PowerShell DSC and its Script Resource. … Continue reading PowerShell DSC: Self Signed SSL Certs

PowerShell Install-Module: Use Install-Package Instead

Hello! When I restarted in the Windows ecosystem, I was installing PowerShell modules like this: This is similar to installing a Python package with pip in Linux: Install-Module installs PSDscResources from the PowerShell Gallery. Pip installs Ansible from PyPI. Like the Linux ecosystem, the Windows ecosystem has several package databases. The PS Gallery I linked … Continue reading PowerShell Install-Module: Use Install-Package Instead

Headless PowerShell DSC Script

Hello! In clouds, "headless" deployment means instances provision themselves when they start. There's no external server infrastructure orchestrating their config, everything they need to do they do on their own. This is the most common deployment pattern I've seen in DevOps. It took me some fiddling to get this pattern set up in PowerShell DSC … Continue reading Headless PowerShell DSC Script

How to Use Out-String in PowerShell: Don’t

In my PowerShell Help Commands For Linux Users post, I showed you this pattern for searching for command aliases: A beginner mistake! Here's the problem: I'm used to the Unix shells, like bash, where everything is a string. When you run alias in bash, you get this: A multiline string with one alias per line. You search … Continue reading How to Use Out-String in PowerShell: Don’t