Variable in PSRemoteConfiguration

I’m trying to define a variable in psSessionConfigurationFile that holds some object (result of import-clixml cmdlet) but it’s being casted to string automatically and all I get is an original object type name.

Any ideas?

Thanks!!!

can you show us the code?

New-PSSessionConfigurationFile -Path C:\temp\sample.pssc -Author Me -VariableDefinitions @{Name="SomeConf";Value=(Import-Clixml C:\Windows\bib\sysprep\GetCompConfig.cfg)} 
Register-PSSessionConfiguration -Name Test -ShowSecurityDescriptorUI -Path C:\temp\sample.pssc
etsn (hostname) -ConfigurationName test
$SomeConf
@{ComputerName=ICT-211-4736; NetAdapterName=Local Area Connection; NetAdapterDescription=Intel(R) Ethernet Connection I217-LM; NetAdapterIndex=7; IP=10.35.211.118; Subnet=255.255.255.0; Router=10.35.211.1; DNS=10.35.170.22;10.35.
170.21;10.35.170.41;10.135.50.9;10.34.2.11;10.34.2.10;10.34.2.39}

And I can’t cast it back to [pscustomobject]

Or with [pscredential]

[pscredential]::new("SomeUser",(ConvertTo-SecureString -Force -AsPlainText "RidiculouslySecurePassword")) | Export-Clixml C:\temp\secureCreds.xml
New-PSSessionConfigurationFile -Path C:\temp\sample1.pssc -VariableDefinitions @{Name="Creds";Value=(Import-Clixml C:\temp\secureCreds.xml)} 
Register-PSSessionConfiguration -Path C:\temp\sample1.pssc -Name Test1


etsn (hostname) -ConfigurationName Test1 

[ICT-211-4736]: PS C:\Users\admin_osmilos\Documents> $Creds
System.Management.Automation.PSCredential

[ICT-211-4736]: PS C:\Users\admin_osmilos\Documents> 

Thanks!!!
Best regards