Reputation: 16221
I have a short PowerShell script which saves me typing time ... maybe in the future when this snippets works ...
The first Expression starts an executable with some parameters (an assembler). If this tool exits with no errors, a Python script is launched with the help of the Python launcher py.exe. In addition to this, I collect all formatted assembler files (*.fmt) and delete them.
When I run this script, the Python script is executed first and after that the assembler runs.
What am I missing here?
Invoke-Expression "..\asm\KCPSM6.exe -c4096 main_KC705.psm"
if ($LastExitCode -ne 0) {
Write-Host "ERROR: KCPSM6.exe return with an error code." -ForegroundColor Red
exit 1
} else {
Invoke-Expression "py.exe -3 ..\py\psmProcessor.py -v main_KC705.log"
$fileList = Get-ChildItem -Path ..\psm -Recurse -Filter *.fmt
$fileList += Get-ChildItem -Path ..\lib -Recurse -Filter *.fmt
$fileCount = $fileList.Count
Write-Host "Deleting $fileCount temporary files."
if ($fileCount -gt 0) {
$fileList | Remove-Item
}
}
Upvotes: 1
Views: 1426