I am going to assume that if you are reading this article that you know what Visual Studio code is and have installed the PowerShell extension for it, so this article isn’t going to tell you how to do any of that. If you don’t know what VS Code is, it is a free, open-source
Author: Jacob Benson
Finding All Client Mailboxes in the Office 365 Partner Portal
Someone at work asked me “how many client mailboxes are we supporting in Office 365?”. It’s easy to tell how many clients you are supporting, as soon as you login to the partner portal it tells you that number. I had never tried to get the number of client mailboxes before, but I strongly suspected
Desired State Configuration: Cannot bind argument to parameter ‘ResourceKey’ because it is an empty string
Applies To: PowerShell Version: 5.0.10240.16384, xComputerManagement 1.2.2, 1.3.0 I was working on a DSC Configuration to build a Hyper-V host, when I encountered the error shown below. So, that’s a pretty awesome error, and not one that I can say that I have seen before. I did A LOT of troubleshooting to figure out what
Warning: Unable to find package provider ‘PSModule’ on Windows 10
Running Windows 10 Enterprise Preview Build 5.0.10158.0 When I run Find-Module, I receive the error message in the screenshot below. After bashing my face against the problem for a while, I got some help from Ben Gelens, who provided the answer on how to fix the problem:
1 |
Get-PackageProvider -Name PSModule -ForceBootstrap |
Once that is done, close and reopen
Unexpected Token ‘}’ in Expression or Statement when using $AllNodes in a Desired State Configuration
I was working on testing a custom DSC Resource when I came across a very strange issue. Whenever I tried to build a Configuration like the one below, it failed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
First Configuration: $ConfigData =@{ AllNodes = @( @{ NodeName = '*' PSDSCAllowPlainTextPassword = $True } ) } Configuration TestConfig{ Import-DscResource -ModuleName @{ModuleName="xComputerManagement";ModuleVersion="1.3.0"} Node $AllNodes.Nodename{ xComputer Test{ Name = "MYPC" } } } |
Under the very last curly brace there was a red squiggly line. When I tried to build the Configuration it failed with the error:
Why Should I Attend the PowerShell Summit?
Starting last fall for the European PowerShell Summit and this year for the North America PowerShell Summit all the session recordings are available on YouTube. Because of that you may be asking yourself “Why should I go to the Summit when I can just watch everything online?”. Here are ten reasons, in no particular order
ValidateSet for a Parameter in a DSC Class Based Resource Fails to Throw Error
While working on a Custom DSC Resource that I started Monday night at the PowerShell Summit I came across some interesting behavior that turned out to be a bug in the WMF 5.0 February Preview. I have logged this issue in Connect, but I wanted to write a blog post to demonstrate what exactly is
Creating a Class based DSC Resource using PowerShell
Scenario: I would like to think I am fairly competent at creating DSC Resources using .MOF files. But with the upcoming release of Windows Management Framework 5.0 we can now write DSC Resources using Classes. I have never done anything with a Class. I am going to attempt to figure out how to write a
cVSS Custom Desired State Configuration (DSC) Resource
I will keep this pretty short and sweet. I was asked to create a Custom DSC Resource that could ensure that Volume Shadow Copies was always enabled on a drive. I thought it would be pretty easy to do, but turns out it wasn’t nearly as easy as I thought. When you enable VSS through
“Undefined Property ConfigurationName” When Starting a DSC Configuration
Update: This issue is resolved in the November 2014 Update Rollup for Windows RT 8.1, Windows 8.1 and Windows Server 2012 R2. Thanks to Dave Wyatt for the heads up! So, there I was today, working on a Custom DSC Resource and when I ran Start-DSCConfiguration I got this error:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsof t/Windows/DesiredStateConfiguration'. VERBOSE: An LCM method call arrived from computer 0497JACOBB with user sid S-1-5-21-2936601924-3794413074-933163191-500. VERBOSE: [DC01]: LCM: [ Start Set ] VERBOSE: [DC01]: LCM: [ End Set ] Undefined property ConfigurationName At line:19, char:2 Buffer: onName = "TestVSS"; };^ insta + CategoryInfo : SyntaxError: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : MiClientApiError_Failed + PSComputerName : dc01.arkenstone.com VERBOSE: Operation 'Invoke CimMethod' complete. VERBOSE: Time taken for configuration job to complete is 0.678 seconds |
Well, what the hell