You people really are sheep . <| sep |> There is almost never a need to dump intermediate data into files GetADComputer filter SearchBase ouOperations Dept , ouCOMPUTERS , ouHQ Office , dccompanyname , dclocal ForEachObject GetWmiObject Win 32 BIOS ComputerName $. name SelectObject Property PsComputerName , SerialNumber ExportCsv path Serials . csvAnd if the long command bothers you just use a variable instead of a file $ computersGetADComputer filter SearchBase ouOperations Dept , ouCOMPUTERS , ouHQ Office , dccompanyname , dclocal $ computersForEachObject GetWmiObject Win 32 BIOS ComputerName $. name SelectObject PsComputerName , SerialNumber ExportCsv path Serials . csv <| sep |> Lol , well thank you for explaining it better