I want to check if some file exists with multiple extension. I tried this way, it works. But I need the simple way to do this process. Is anyone can give me advice how to improve this process? Thank you so much.
$Data = "D:\Folder"
if (!(Test-Path $Data\*.que))
{
if (!(Test-Path $Data\*.pro))
{
if (!(Test-Path $Data\*.err))
{
if (!(Test-Path $Data\*.skip))
{
Write-Host "Complete"
}
else {
Write-Host "Finished, But Not Complete"
}
}
else {
Write-Host "Finished, But Not Complete"
}
}
else {
Write-Host ".pro Exist, Not Finished"
}
}
else {
Write-Host ".que Exist, Not Finished"
}