I\'m trying to get Uri to stop encoding \'/\' As explained here: GETting a URL with an url-encoded slash
But how to achieve the same in powershell ?
I\'m tr
Taking that other post as what you need, you want this:
$uri = [uri]"http://example.com/%2F"
$f = [uri].getfield("m_Flags", "nonpublic,instance")
$v = [int]($f.getvalue($uri))
$f.setvalue($uri, [uint64]($v -band (-bnot 0x30)))
PowerShell's -bnot
and -band
bitwise operators don't work with any types bigger than [int]
so I'm downcasting to [int]
which does not overflow for the above case (which means flag values beyond [int]::maxvalue
are not present.)