ファイルの存在を検証しようとしていますが、問題は、ファイル名の名前に角かっこが含まれていることです。つまり、c:\ test [R] 10005404、Failed with Comments、[S]SiteName.txtです。
string .replaceメソッドを使用しようとしましたが、成功しませんでした。
$a = c:\test\[R] 10005404, Failed with Comments, [S] SiteName.txt
$Result = (Test-Path $a)
# Returns $False even though the file exists.
試してみました
$a = $a.Replace("[", "`[")
$a = $a.Replace("]", "`]")
$Result = (Test-Path $a)
# Also returns $False even though the file exists.
アイデアをいただければ幸いです。ありがとう、ChrisM