PowerShell DSC Journey – Day 13

When I left off yesterday I had a functioning Custom Resource. By functioning I mean that I can run some tests without errors (unless it should error) and that it can create a new Hardware Profile name if one doesn’t exist. Other than that, it’s pretty much worthless. So, let’s add in a few more

Read More

PowerShell DSC Journey – Day 12

Before I get started working on the Set-TargetResource function, it occurred to me over the weekend that instead of using $Name -cin $HWProfile.Name I should be using $Name -match $HWProfile.Name because otherwise I could just put a name like “Web” and who knows what would happen. Probably not anything good. So, I make that change

Read More

PowerShell DSC Journey – Day 10

When we left off yesterday I believed that I had a functioning Get-TargetResource function, without yet actually getting to the part where I Get anything. Which begs the question whether or not I actually need all that other stuff in there, or if it belongs in the Test-TargetResource. I honestly have no idea, I am

Read More

PowerShell DSC Journey – Day 9

When I left off I had modified my Get-Target resource function to include steps for checking to make sure SCVMM cmdlets existed, and that the specified VMM Server was a valid VMM Server. Next, I need to make sure that the given Name of the Hardware Profile exists. The issue I run into here is

Read More

PowerShell DSC Journey – Day 8

Alright. Picking up where I left off yesterday, this time I am seriously going to work on the Get, Test and Set Functions for my first custom DSC Resource. I promise I won’t get myself sidetracked by why I need the full path to import my Module :). First things first, here is the code

Read More

PowerShell DSC Journey – Day 7

Alright, so yesterday I was able to successfully create a very simple (and that is putting it mildly) DSC Resource. It currently only has only 3 parameters: Ensure, Depends On, and Name. Today I am going to start writing the Get,Set,Test Functions and testing them (hopefully). Here are my 3 main references for this task:

Read More

PowerShell DSC Journey – Day 6

Yesterday I started working on a Custom DSC Resource for creating a SCVMM Hardware Profile. While I was at home last night I bit the bullet and made the decision that I was getting a bit ambitious with this and needed to start small. So, instead of all the Resource Properties I had yesterday, I

Read More

PowerShell DSC Journey – Day 5

In my last 5 or so posts, I have explored a little bit further deploying VMs using the Hyper-V Resources. While this is great, it limits what I can do from a VM deployment scenario. Especially when I have VMM at my disposal. So, I am going to go down the route of creating my

Read More

PowerShell DSC Custom Resource Journey – Day 4

Alright, today I am going to build a Hyper-V VM on my local workstation using the xVMHyperV Resource.  Here is what my current Configuration script looks like.

If you remember from my last post, the xVHD Resource only creates VMs with Dynamic Memory and Dynamic disks. The disk I am attempting to use is

Read More