Powershell Bad Code #5: Search files with square brackets not working By powershellgu | July 5, 2015 0 Comment Question: Why this code doesn’t display files with with square brackets? Not working Working Answer : PowerShell # Answer: Get-ChildItem -LiteralPath 'C:\demo\[file].txt' # Explanation: -LiteralPath : this parameter looks for the path exactly as it was typed (even if ii includes a reserved character). 12345 # Answer:Get-ChildItem -LiteralPath 'C:\demo\[file].txt' # Explanation:-LiteralPath : this parameter looks for the path exactly as it was typed (even if ii includes a reserved character).