Skip to content

Instantly share code, notes, and snippets.

@hsimah
Created June 22, 2019 00:51
Show Gist options
  • Save hsimah/1c34e6331bdbba8015d348bfda02e461 to your computer and use it in GitHub Desktop.
Save hsimah/1c34e6331bdbba8015d348bfda02e461 to your computer and use it in GitHub Desktop.
# Clean a filename
$Path.Split([IO.Path]::GetInvalidFileNameChars()) -join '_'
# Clean a directory path
$Path.Split([IO.Path]::GetInvalidPathChars()) -join '_'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment