Graph Week – Exploring the MSGraphAPI Cmdlets

Yesterday, I showed you how to install and start with the MSGraphAPI cmdlets. Today we’re going to explore them and see all that you can do with them! We learned how to authenticate yesterday, and run the first command: Get-GraphUsers. What does this command return? I can use GetType to see: It’s not just returning a hash or array, it’s returning a custom class called GraphUser_v1. What is this object? This is a custom object created for the cmdlets that … Continue reading

Graph Week – Getting Started with Graph and PowerShell!

Welcome to Graph week! This week we are going to look at how we can automate common tasks with PowerShell and Microsoft Graph. To help us out, I am working on cmdlets called the MSGraphAPI cmdlets. They are in beta now, but far enough along to do anything you need to do in Graph! What is Microsoft Graph? Graph is one endpoint to manage multiple Microsoft APIs. What do I mean by that? In the Graph cmdlets, you can simply … Continue reading

Pester Testing .Net with PowerShell Classes

One problem I’ve come across with Pester is it has no good way to Mock .Net objects. This hasn’t caused me too much trouble as I can just wrap .Net methods in functions and mock the function, but I had a case come up where I needed to specify the .Net type in my function parameter, so I couldn’t just wrap this in a function:

As you can see, I’m specifying the type and it is a required parameter, … Continue reading

PowerShell Tip: Add Parameters to Registry for Easy Access

I tend to work on large PowerShell scripts that accept parameters. In the past I’ve always defined these parameters in the script while I test, and then I have to go back and remove them when I blog about the script here. I decided I’d figure out an easier way to do this! I’m already using my ISE addon to run scripts in a new PowerShell session, so I decided to edit that to add parameter support! First off, I … Continue reading

Building a SCCM Lab with 1606

One of the things I do pretty often is rebuild my lab. I do this with a series of scripts I posted to GitHub called the EphingLab. I decided to post about my SCCM 1511 install script that not only installs SCCM, but also updates it to the latest version (1606 currently). If you’d just like to get the script and try it out yourselves, the link to SCCM script is here. I’m not going to cover the entire script … Continue reading

How to use PowerShell to start ConfigMgr updates in current branch

I’m one of those people who rebuilds their test lab often. I like to tinker with WMI and all sorts of other things, so I rebuild to wipe all my configuration changes and start fresh. Current Branch has put a wrinkle in this because I could never start the updates automatically with my build script. Well, I’ve figured out how to start the SCCM updates with a script!

The above code will start the KB3174008 update: You can now … Continue reading

Azure Automation Week–Get Input from the SCSM Portal

Most of the time when we are imaging computers, there is a reason for it. This reason will be tracked in some form of ticketing system, so why are we asking questions in the task sequence? We have all the answers already! In this post, I’m going to show you how to get the answers to portal questions in SCSM, and then return those as JSON! In order to do this, there are some hurdles we must overcome. They are: … Continue reading

The Automatic Packager!

One of the highlights of MMS for me was the hackathon. It wasn’t just because I won a Surface, but also because we got to see our ideas come to life in 3 days! One of the ideas that wasn’t coded was to automatically create packages from folders. This was a great idea, but neither the Microsoft Product Team or Coretech decided to take it on. I decided to take it on with my new Surface, and was able to … Continue reading

Better Know a PowerShell UI: Talk to a duck!

If you’ve been following along, you’re in a bit of a pickle. You bought your duck and used the computer to quack at the duck, but now your duck has probably decided the computer is their mom, so it isn’t listening to your voice at all! How do we fix that? Let’s build a UI to make the computer say whatever we want! We are going to start this blog post with an already created UI. If you want to … Continue reading

Better Know a PowerShell UI: Let’s go buy a duck (Part 2)

Welcome to the fourth installment of my long running series Better Know a PowerShell UI. Last time we designed an interface in Visual Studio for buying a duck. It’s a very simple user interface because when we buy ducks we want it now and don’t want to have to fill out lots of forms. Today, we are going to move that interface over to PowerShell and make the button buy a duck! First off, you’ll want to make sure you … Continue reading