Working With Weird Filenames
Files with "--"
Use the .\
prefix for relative paths or specify the full path.
For cmdlets, you might also use the --%
operator, which signals PowerShell to stop parsing the command line, passing the rest of the command directly to a native command.
Leading or Trailing Spaces
Enclose the filename in quotes and use the backtick (`) as the escape character for trailing spaces in PowerShell.
Wildcard Characters (*, ?)
Directly use them in quotes if they are part of the filename.
Last updated
Was this helpful?