When running a script, you may see the following error:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/Windows/DesiredStateConfiguration'.
The WS-Management service cannot process the request. The WMI service returned an 'access denied' error.
+ CategoryInfo : PermissionDenied: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : HRESULT 0x80338104
+ PSComputerName : localhost
Solution:
Make sure you start your PowerShell session with Run as administrator option.
When running a script, you may run into the following issue:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' =
SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' =
root/Microsoft/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 : localhost
Solution:
The solution for this issue is to increase the maximum envelope size, by running the following command in an elevated PowerShell session:
Set-Item -Path WSMan:\localhost\MaxEnvelopeSizeKb -Value 2048
Loading a script fails:
.\SetupMachine.ps1 : File C:\Users\babydragon\Documents\windows-machine\SetupMachine.ps1 cannot be loaded because
running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\SetupMachine.ps1
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Change machine level PowerShell ExecutionPolicy to RemoteSigned
in the
LocalMachine
scope:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
cChoco modules fail to run:
Importing module cChocoPackageInstall failed with error - File C:\Program
Files\WindowsPowerShell\Modules\cChoco\2.4.0.0\DscResources\cChocoPackageInstall\cChocoPackageInstall.psm1 cannot be loaded. The file C:\Program
Files\WindowsPowerShell\Modules\cChoco\2.4.0.0\DscResources\cChocoPackageInstall\cChocoPackageInstall.psm1 is not digitally signed.
Solution:
Change machine level PowerShell ExecutionPolicy to RemoteSigned
in the
LocalMachine
scope:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
You're seeing the following error when trying to run configuration scripts:
The client cannot connect to the destination specified in the request. Verify
that the service on the destination is running and is accepting requests.
Consult the logs and documentation for the WS-Management service running on
the destination, most commonly IIS or WinRM.
Solution:
Configure WinRM.
You're seeing the following error when enabling WinRM and you have Hyper-V enabled:
WinRM firewall exception will not work since one of the network connection
types on this machine is set to Public. Change the network connection type
to either Domain or Private and try again.
Solution:
Run following command to find the InterfaceIndex
value:
Get-NetConnectionProfile
Hyper-V network will show up as Unidentified network
:
Name : Unidentified network
InterfaceAlias : vEthernet (Default Switch)
InterfaceIndex : 17
NetworkCategory : Public
IPv4Connectivity : NoTraffic
IPv6Connectivity : NoTraffic
Change network category to Private using the correct InterfaceIndex
value:
Set-NetConnectionProfile -InterfaceIndex 17 -NetworkCategory Private