WinRM MaxEnvelopeSize quota

While testing your Desited State Configuration configuration you may receive next error message during exectuion of Start-DscConfiguration:

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsof
t/Windows/DesiredStateConfiguration'.
The WinRM client sent a request to the remote WS-Management service and was notified that the request size exceeded the configured MaxEnvelopeSize quota.
    + CategoryInfo          : LimitsExceeded: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : HRESULT 0x80338111
    + PSComputerName        : machinename
 
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 5.074 seconds

There is already suggestion on Microsoft Connect about this behavior: WSMan MaxEnvelopeSize Limits DSC Configurations. Sine it has been almost a year now and it's got only six votes, I don't think it will be increased by default.
Most obvious solution is just to increase it. Run next in elevated PowerShell host:

Set-Item -Path WSMan:\localhost\MaxEnvelopeSizekb -Value 1024

Note that default value on my Windows 8.1 machine was 500.
But do not be in hurry to execute it. By default DSC generates its .mof file in UTF-16. Just convert them to UTF-8 preferably without BOM and it should help by decreasing its size two times. Now you can enjoy your automated configuring.

Show Comments