Hello! I like my code to stop on errors, not continue past them. For example, if a script fails to enable logs for my app I want to know right away. I don't want to find out tomorrow when I need logs that aren't there. The earlier I know about errors, the better. I learned … Continue reading PowerShell DSC: Stop On Errors
Category: PowerShell DSC
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 DSC EXE ProductID And Name
Hello! PowerShell DSC can install EXEs with its Package resource: Path is easy, it's just the path to the installer. But what goes in Name or ProductID? Let's use WinRAR as an example. You shouldn't actually install this with DSC, you should use Chocolatey, but I needed something to demo. There are lots of instructions … Continue reading PowerShell DSC EXE ProductID And Name
PowerShell DSC In Vagrant
I work mostly on Apple Mac OS X. I've also been writing a lot of Windows automation, and that means PowerShell DSC. PSDSC doesn't work on OS X yet, and even once it does I won't be able to test Windows-only resources. To test my configurations, I use Vagrant boxes. It took a little fiddling … Continue reading PowerShell DSC In Vagrant
Which PowerShell DSC Resources Module To Import
Hello! These three modules all implement various PowerShell DSC resources: PSDesiredStateConfiguration xPSDesiredStateConfiguration PSDscResources That gives us three top-level Import-DSCResource lines we could use in configurations (check out this article for an in-context example): Here are the differences: PSDesiredStateConfiguration is the built-in module that ships in Windows as part of PowerShell 4.0. xPSDesiredStateConfiguration is an experimental version of … Continue reading Which PowerShell DSC Resources Module To Import
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