I am trying to set a bunch of files to read-only. However when I call
Set-ItemProperty -LiteralPath $path -Name IsReadOnly -Value $true
it tells me that my path does not exist. The path points to a file which I am sure is present at the stated location. If I follow the path in the explorer I will end up at the file without any problems. Why does it say it does not exist?