Skip to content

Instantly share code, notes, and snippets.

@Windos
Created August 14, 2019 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Windos/b71163278b287a124ac29f96eb0df0e4 to your computer and use it in GitHub Desktop.
Save Windos/b71163278b287a124ac29f96eb0df0e4 to your computer and use it in GitHub Desktop.
$Files = Get-ChildItem -Path 'C:\Temp' -Filter "*.tsv" -Recurse
$Directories = $Files | Group-Object -Property 'DirectoryName'
foreach ($Directory in $Directories) {
$Outfile = Join-Path -Path $Directory.Name -ChildPath '\HTML-File-Name.html'
# Start your HTML file here, add CSS or headings.
foreach ($File in $Directory.Group) {
Import-Csv -Delimiter "`t" -Path $File.FillName | ConvertTo-Html | Out-File -FilePath $Outfile -Append
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment