I used to link to this
But it now needs to go here
I used to link to this
But it now needs to go here
You can use this syntax to remove any trailing slash ‘\’ to a path and add it back in if it’s a string.
# Remove slash
$OutPath = $Path.TrimEnd('\')
# Remove if exists and add back in
$OutPath = $Path.TrimEnd('\') + '\'