Forum Discussion

Juan_Ra1974's avatar
Juan_Ra1974
Copper Contributor
May 24, 2022

Powershell DSC not working in remote computer

Hello

I recently discovered DSC Resouces and I think it's great, I've started doing senzy tests and I run into this problem:

If I run the following code in local it works correctly

Invoke-DscResource -Name Registry -ModuleName PSDesiredStateConfiguration -Method set -Property @{
        key = "HKLM:\SOFTWARE\ExampleRegistry";
        ValueName = "TestData";
        ValueType = "String";
        ValueData = @("Hola")
}

If I run the following code on a remote PC

Invoke-Command -ComputerName PCXXX -ScriptBlock {
    Invoke-DscResource -Name Registry -Method Set -Property @{
        key = "HKLM:\SOFTWARE\ExampleRegistry";
        ValueName = "TestData";
        ValueType = "String";
        ValueData = @("Hola")
    } -Verbose -ModuleName PSDesiredStateConfiguration
}

Failure with error "serialized xml is nested to deeply"

From here I have tried with different DSCs, but always with the same error.

Has anyone encountered this error?

Thank 

 

No RepliesBe the first to reply

Resources