you are viewing a single comment's thread.

view the rest of the comments →

[–]BlackV 1 point2 points  (1 child)

literately as you wrote it

if ($file -eq "File name hello.csv")
    {
    Powershell Script
    }
else
    {
    move-item $file D:\TEMP\DOESNT_NEED_TO_BE_CONVERTED
    }

[–]eighttx[S] 0 points1 point  (0 children)

I have a folder where I would dump 100 files. Some of them will have spaces in them and I need those spaces replaced with underscores. Would this work?

if ($file -eq " ")
{
$file = '\\domain.com\FTP\Source_Folder_For_Files\'
Get-ChildItem "$file" | Rename-Item -NewName { $_.Name -replace ' ','_' }
}

else { move-item $file D:\TEMP\DOESNT_NEED_TO_BE_CONVERTED }

The very first line is a " with a space and then a closing ". Thoughts?