Comparing Objects using JSON in PowerShell for Pester Tests

Recently I spent the good part of a weekend putting together Pester Tests (click here if you aren’t familiar with Pester) for my LabBuilder PowerShell module- a module to build a set of Virtual Machines based on an XML configuration file. In the module I have several cmdlets that take an XML configuration file (sample below) and return an array of hash tables as well as some hash table properties containing other arrays - basically a fairly complex object structure.
Read full post gblog_arrow_right

PowerShell CmdLets available in the Containers Module on a Nano Server

Just a Monday morning quickie: Here is a list of all the cmdlets available in the PowerShell containers module on a Nano Server with the containers package installed: Containers - the next big thing! And here is the text version: Function Install-ContainerOSImage 1.0.0.0 Containers Function Uninstall-ContainerOSImage 1.0.0.0 Containers Cmdlet Add-ContainerNetworkAdapter 1.0.0.0 Containers Cmdlet Connect-ContainerNetworkAdapter 1.0.0.0 Containers Cmdlet Disconnect-ContainerNetworkAdapter 1.0.0.0 Containers Cmdlet Export-ContainerImage 1.0.0.0 Containers Cmdlet Get-Container 1.0.0.0 Containers Cmdlet Get-ContainerHost 1.
Read full post gblog_arrow_right

Nano Server Technical Preview 3 Available Now!

Naturally, right as I need to be focusing on rebuilding my lab environment (using PowerShell scripts only of course), Microsoft goes and releases Windows Server 2016 Technical Preview 3, which contains lots of cool things like containers. It also meant a new version of the awesome Nano Server. But this time, Microsoft has released an installer script called new-nanoserverimage.ps1 on the ISO in the Nano Server folder. This means that my script new-nanoservervhd.
Read full post gblog_arrow_right

Prevent Template VIrtual Machines from Accidentally being Booted

Here’s a quick tip for Wednesday night: If you have a VM you have syspreped so that you can use it as a template to create other new VM’s, set the VHD/VHDx file(s) for the VM read-only so that you won’t unsysprep (is that a word?) it by accident. I have spent many wasted minutes re-sysprepping VM’s because I accidentally booted up a template VM.

Replace NETSH TRACE START with PowerShell

Recently as part of studying for my MCSA I have been using Message Analyzer to look at Kerberos exchanges (among other things). Yes, I really know how to party! I usually did this by starting the trace on the KDC (DC) using the good old command: NETSH TRACE START CAPTURE=yes TRACEFILE=e:\mytrace.etl Followed by this command to stop the trace: NETSH TRACE STOP This works very well. I also read this great article on TechNet on streamlining remote traces.
Read full post gblog_arrow_right