PowerShell DSC Journey – Day 17

Alright. So yesterday I worked through some issues in the Set-TargetResource Function and left off with a big one still remaining. Namely, that even though I have Ensure = Present in my test of the Function, it is running through the Ensure = Absent portion of the script if the Hardware Profile already exists, which

Read More

PowerShell DSC Journey – Day 16

When I left off yesterday I had a somewhat functioning Set-TargetResource function. I use functioning in the way that when something kind of works and doesn’t throw errors but doesn’t actually do anything functions. So, today I am going to be figuring out where I screwed up my logic and getting this Resource to work.

Read More

PowerShell DSC Journey – Day 15

So when I left off yesterday I appeared to have my Get and Test TargetResource functions working properly, now it’s time to work on the Set-TargetResource function, which is probably where the fun will happen. When I go to set the Resource, I have a couple of different scenarios I need to work through. Hardware

Read More

PowerShell DSC Journey – Day 14

When I left off yesterday, I had modified my Get-TargetResource to work (hopefully) with all the new properties I had setup for my Custom Resource. Now, I am going to test this, and DSC willing I will be able to move on to the Target Resource functions today before I finish this thing out. First

Read More

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