The below script is running in a for-each loop and the output heading is not coming in the right order. I want the output order as I mentioned in the hash table. **I want the CSV table column heading in right order**, not the data inside the table.

Like 1.Machine\_Name, 2.Ping\_Status, 3.OS\_Name

How can I solve this?

```
$Result = @{
            MACHINE_NAME     = "$_"
            PING_STATUS      = "MACHINE ONLINE"
            OS_NAME = "$OSNAME"
        }

$Details += New-Object PSObject -Property $Result
$Details | export-csv -Path $pathofcsv -NoTypeInformation

```