Hey Guys,
I'm unable to get this to work correctly. I'm trying to see which folders have a file within them with the word "preview". If it does, then tell me it exists, if not, then it doesn't exist.
What am I missing?!? Ugh :(
Here is my code
I'm unable to get this to work correctly. I'm trying to see which folders have a file within them with the word "preview". If it does, then tell me it exists, if not, then it doesn't exist.
What am I missing?!? Ugh :(
Here is my code
$rootpath = "T:\Path1\Path2\*"
foreach ($f in Get-ChildItem $rootpath)
{
foreach ($i in Get-ChildItem $f)
{
if (Test-Path $i -include *preview*.jpg)
{
echo($i.name + " Preview Exists")
}
else
{
echo($i.name + " ***PREVIEW MISSING***")
}
}
}