Closed Lucide closed 5 months ago
Try importing the module before you import the clixml. The module includes special code to convert the custom object you get from Import-CliXml
into an actual displayconfig, see: https://github.com/MartinGC94/DisplayConfig/blob/main/PowerShellTypeFiles/DisplayConfigType.ps1xml and https://github.com/MartinGC94/DisplayConfig/blob/main/src/DisplayConfig/API/DisplayConfigConverter.cs
Ooh, that explains the inconsistent behaviour I was seeing in different pw sessions, I thought it was time for bed🤣. I would've never guessed,
thank you🙂
Hi, it's me again 🙇♂️ I'd like to have access to getters for serialized configs. Use case: I need to load a config and set a resolution to its primary display before applying. The
API.DisplayConfig
class has aGetPrimaryDisplayId()
, but a deserialized object has no methods. A way to do this would be with static methods inDisplayConfig
. But then i read here, and it seems to me that the function is calling theSetDisplayResolution(id, Width, Height);
method on an object from the pipeline. But this works with serialized objects too, why?🤔Another way would be to have a constructor that takes a deserialized object and creates a "live object" instance. I found no explicit constructor for
DisplayConfig
but I can see one being used here, with what looks like a literal initialization.