0

I know there are already some threads on this, but i dont get it...

ive got a list of file locations from a sql and extract them:

$results = --SQL QUERY--
$result = $results | select Dateipfad, Pfad, Datei, etc...
$dateipfad = $result | select Dateipfad
$dateipfad
Dateipfad
\\fs-srv01\folder1\folder2\file1.pdf
\\fs-srv01\folder1\folder2\file2.pdf
\\fs-srv01\folder1\folder2\file3.pdf
\\fs-srv01\folder1\folder2\file4.pdf

and when testing with Test-Path -Path $Dateipfad i get:

False
False
False
False

but when i use Test-Path -Path '\\fs-srv01\folder1\folder2\file4.pdf' its always true

2

1 Answer 1

0

alright i fixed it by using Test-Path -Path ('filesystem::'+$_.dateipfad)

and adding filesystem:: to the path

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.