Hi, has anyone used data access classes before with PowerShell?
I have a custom class and inside it is a method to add the object to a directory with
$Object | ConvertTo-Yaml | Out-File -Path $Object.Path
$Object | Export-CLiXml -Depth 9999 -Path $Object.MachinePath
to store the object in YAML format and to store the export-clixml output so i can rehydrate my object for when I want to run a Get-Object function.
I didn’t know export-clixml and import-clixml returned different object types, and casting the object to original type on import-clixml fails.
Apparently a data access class gets around this, but I’ve never seen the structure of this. Can anyone point me in the right direction?
The class object is a subclass of a base class which has nothing in the default constructor, but populates some information by default which would change the object.
Is there a way forward here?
Thanks ,
AJ