Accessing private members from powershell

前端 未结 4 1429
日久生厌
日久生厌 2021-01-12 10:39

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

4条回答
  •  深忆病人
    2021-01-12 11:26

    try this (like in your link):

    $uri.GetType().GetField("m_Flags", [System.Reflection.BindingFlags]::Instance -bor `
     [System.Reflection.BindingFlags]::NonPublic)
    

    to get non public properties:

    $uri.GetType().GetProperties( [System.Reflection.BindingFlags]::Instance -bor `
    [System.Reflection.BindingFlags]::NonPublic )
    

提交回复
热议问题