2022-01-05 13:17:59 +13:00
if ( Test-Path -Path $args [ 0 ] -PathType Leaf ) {
2022-11-30 05:48:24 +13:00
$file = $args [ 0 ]
2022-01-05 13:17:59 +13:00
}
else {
2022-11-30 05:48:24 +13:00
Write-Host " CANNOT FIND LOG FILE "
Exit 1
2022-01-05 13:17:59 +13:00
}
2022-11-30 05:48:24 +13:00
if ( $null -ne $args [ 1 ] ) {
$output = $args [ 1 ]
Write-Host " Outputting IDs to $output "
2022-01-05 13:17:59 +13:00
}
else {
2022-11-30 05:48:24 +13:00
$output = " ./failed.txt "
2022-01-05 13:17:59 +13:00
}
2022-11-30 05:48:24 +13:00
Select-String -Path $file -Pattern " Could not download submission " | ForEach-Object { -split $_ . Line | Select-Object -Skip 11 | Select-Object -First 1 } | ForEach-Object { $_ . substring ( 0 , $_ . Length - 1 ) } > > $output
2022-01-05 13:17:59 +13:00
Select-String -Path $file -Pattern " Failed to download resource " | ForEach-Object { -split $_ . Line | Select-Object -Skip 14 | Select-Object -First 1 } > > $output
2022-11-30 05:48:24 +13:00
Select-String -Path $file -Pattern " failed to download submission " | ForEach-Object { -split $_ . Line | Select-Object -Skip 13 | Select-Object -First 1 } | ForEach-Object { $_ . substring ( 0 , $_ . Length - 1 ) } > > $output
2022-01-07 00:16:44 +13:00
Select-String -Path $file -Pattern " Failed to write file " | ForEach-Object { -split $_ . Line | Select-Object -Skip 13 | Select-Object -First 1 } > > $output
2022-01-05 13:17:59 +13:00
Select-String -Path $file -Pattern " skipped due to disabled module " | ForEach-Object { -split $_ . Line | Select-Object -Skip 8 | Select-Object -First 1 } > > $output