davehull / Kansa

A Powershell incident response framework
Apache License 2.0
1.56k stars 266 forks source link

Kansa Core Bug: Convert-CSV invalid Cmdlet #135

Closed jvaldezjr1 closed 9 years ago

jvaldezjr1 commented 9 years ago

PowerShell v4- got an error when trying to convert output to TSV indicating that Convert-CSV is not a valid cmdlet. I believe the correct cmdlet should be ConvertTo-CSV instead. Changing in my fork and sending a pull request. Below is the snippet:

# save the data
switch -Wildcard ($OutputFormat) {
...
      "*tsv" {
         $Outfile = $Outfile + ".tsv"
          # LogParser can't handle quoted tab separated values, so we'll strip the quotes.
          $Recpt | Convert-Csv -NoTypeInformation -Delimiter "`t" | ForEach-Object { $_ -replace "`"" } | Set-Content -Encoding $Encoding $Outfile
      }
...
davehull commented 9 years ago

Damn. Nice catch Juan. I've fixed it. This demonstrates the need for something like Pester.