Suppose on disk D: there is a file test.txt. You can check its availability:
#устанавливаем месторасположение Set-Location "d:\" $a="test.txt" #проверка на наличие файла Test-Path $a
But now how to read its properties. I wanted it like $ a.name, but this does not work, because it is a string, not a file object. How to get not a string, but a link to a file?