Skip to content

Instantly share code, notes, and snippets.

@LarryWeiss
Created June 22, 2019 20:58
Show Gist options
  • Save LarryWeiss/2bbeb38ebb2c892af28bb33be11a7d15 to your computer and use it in GitHub Desktop.
Save LarryWeiss/2bbeb38ebb2c892af28bb33be11a7d15 to your computer and use it in GitHub Desktop.
del outfile*.txt -ea 0
$fn = 0
gc file.txt |
% {
if ($_ -eq '-----BEGIN CERTIFICATE-----')
{
$fn++
$fname = 'outfile'+$fn+'.txt'
$fname
}
$_ >>$fname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment