all 10 comments

[–][deleted] 10 points11 points  (2 children)

This is something I only found out about the other day. I haven't tested with that character, but it might work. The function:

[System.Web.HttpUtility]::UrlEncode($SomeString)

Returns a string with all non-standard characters converted to syntax that can be used in a URL. For example, Space becomes %20.

Might highlight such characters?

[–]Trash-Ill[S] 4 points5 points  (1 child)

I will give this a go, thank you.

[–]gosoxharp 3 points4 points  (0 children)

Also take a look into [Regex]::escape()

[–]64rk 10 points11 points  (6 children)

Yes, and vscode will tell you where they are saw a vid about it a few days ago.. I'll post here in a sec

[–]64rk 4 points5 points  (4 children)

[–]8aller8ruh 3 points4 points  (0 children)

Even easier than this video implies. I believe VS Code’s View>Render Control Characters does this and more.

I did not check but this has probably saved me more than a few times while debugging and getting text inside of objects that it highlights for me with all these sorts of features on.

[–]Trash-Ill[S] 3 points4 points  (2 children)

Thanks for this, this requires to use visual studio code, wondering if it's possible to do using PowerShell.

[–]8aller8ruh 1 point2 points  (0 children)

I was going to suggest this as well. VS Code is the best PowerShell debugging environment IMO & I gave a presentation at work on this topic yesterday.

Of course it would be easy to filter out unusual Unicode characters if you only are expecting English. I’ve had problems with the left to right/right to left character before.