Parameter "Path" expects a path, not a filename.
I tried to run line 10 to 16 but i get this error instead based on the snippet below. What should I do ?
PAYVINDRA SELVEN A/L TAMIL SELVEN
0
Reputation points
2 answers
Sort by: Most helpful
-
-
Rich Matheisen 46,711 Reputation points
2024-03-28T18:20:11.8033333+00:00 If $file.path is $null that would point to a problem in your CSV file. Is there a column named "path" in the CSV file? Are there any empty rows in the CSV file? Does any row in the CSV have an empty value in the "path" column?
Also, if you're expecting a complete path (e.g., c:\directory\name.extension) to a file to be present in the "path" column of the CSV you should probably add -PathType Leaf to the Test-Path cmdlet.