unescape unicode 字符串 powershell

Amb*_*ung 2 unicode powershell decode

在PowerShell中,如何对unicode转义字符串进行转义?

$str1 = "http:\u002f\u002fgoogle.com\u002fsomething\u002ftest"
Run Code Online (Sandbox Code Playgroud)

http://google.com/something/test
Run Code Online (Sandbox Code Playgroud)

Amb*_*ung 7

执行此操作的代码是:

[Regex]::Replace($str1, "\\[Uu]([0-9A-Fa-f]{4})", 
         {[char]::ToString([Convert]::ToInt32($args[0].Groups[1].Value, 16))} )
Run Code Online (Sandbox Code Playgroud)