locked
Sorting data from powershell into CSV RRS feed

  • Question

  • Hi All,

    Probably a really quick one for someone who knows what they are doing, but I am looking for some help with a powershell script that is outputting to a CSV file.  The current script is:

    "logoff {0} {1} {2:yyyy-MM-dd HH:mm:ss}"-f$env:username,$env:computername,(Get-Date) >>\\ewwdata01\Public\loginalert\logoff.csv

    Which gives the following result = logoff andysten0023 LT130 2017-10-19 14:56:47

    What I am looking for is for the CSV to have the files broken up in to logoff, andysten0023, LT130, 2017-10-19, 14:56:47

    Is there an easy way of doing this, as i am a newbie to this and struggling a touch!

    Thanks

    Thursday, October 19, 2017 3:31 PM

All replies