Set Resharper loadFromRemoteSources


/ Published in: Windows PowerShell
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function Set-ResharperLoadFromRemoteSources
  2. {
  3. <#
  4. .SYNOPSIS
  5. Adds .NET4 loadFromRemoteSources to all Test Runner config files of Resharper.
  6.  
  7. .DESCRIPTION
  8. This script may be needed if you execute tests from a share environment (i.e. Clearcase views).
  9.  
  10. .NOTES
  11. Removes the Readonly attribute on the files that are applied with the ReSharper installation.
  12. Needs to run elevated.
  13. #>
  14.  
  15. [CmdletBinding()]
  16. param ()
  17. $programFilesX86 = &{if ([IntPtr]::Size -eq 8) {${env:ProgramFiles(x86)}} else {$env:ProgramFiles}}
  18. $files = (dir "$programFilesX86\JetBrains\ReSharper\v5.1\Bin\JetBrains.Resharper.TaskRunner*exe.config")
  19. $files| %{$_.Attributes = $_.Attributes -band (-bnot [IO.FileAttributes]::ReadOnly)}
  20. $files | %{
  21. [xml]$config = Get-Content $_.FullName
  22. $node = $config.CreateElement("loadFromRemoteSources")
  23. $node.Attributes.Append($config.CreateAttribute("enabled"))
  24. $node.enabled = "true"
  25. $config.configuration.runtime.AppendChild($node)
  26. $config.Save($_.FullName)
  27. }
  28. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.