Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. $netAssembly = [Reflection.Assembly]::GetAssembly([System.Net.Configuration.SettingsSection])
  2.  
  3. if($netAssembly)
  4. {
  5. $bindingFlags = [Reflection.BindingFlags] 'Static,GetProperty,NonPublic'
  6. $settingsType = $netAssembly.GetType('System.Net.Configuration.SettingsSectionInternal')
  7.  
  8. $instance = $settingsType.InvokeMember('Section', $bindingFlags, $null, $null, @())
  9.  
  10. if($instance)
  11. {
  12. $bindingFlags = 'NonPublic','Instance'
  13. $useUnsafeHeaderParsingField = $settingsType.GetField('useUnsafeHeaderParsing', $bindingFlags)
  14.  
  15. if($useUnsafeHeaderParsingField)
  16. {
  17. $useUnsafeHeaderParsingField.SetValue($instance, $TRUE)
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement