I have an array that I'm populating by some other means. It essentially contains this sample data;
PSComputerName ResourceName InstanceName InDesiredState ConfigurationName StartDate
-------------- ------------ ------------ -------------- ----------------- ---------
server1.domain.local WindowsFeature Backup True BaseConfig 24/04/2018 14:31:23
server1.domain.local Registry fDenyTSConnections True BaseConfig 24/04/2018 14:31:23
server1.domain.local Registry UserAuthentication True BaseConfig 24/04/2018 14:31:23
server1.domain.local File DscDemo True BaseConfig 24/04/2018 14:31:23
server5.domain.local WindowsFeature Backup True BaseConfig 24/04/2018 14:31:23
server5.domain.local Registry fDenyTSConnections True BaseConfig 24/04/2018 14:31:24
server5.domain.local Registry UserAuthentication True BaseConfig 24/04/2018 14:31:24
This is dynamic, and I'll have no idea when the array is populated what data will be inside. I need to split the array, into unique arrays (or PSObjects) based on the PSComputerName.
So in this case, I'd need to end up with two seperate objects/arrays for server1 and server5, bearing in mind there could be 6 servers or 80 servers. I can't think of the best way to approach this.