Posted By

thomykay on 03/28/11


Tagged

configuration clearcase PowerShell Resharper


Versions (?)

Set Resharper loadFromRemoteSources


 / Published in: Windows PowerShell
 

  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| %{$_\3.Attributes = $_\3.Attributes -band (-bnot [IO.FileAttributes]::ReadOnly)}
  20. $files | %{
  21. [xml]$config = Get-Content $_\3.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($_\3.FullName)
  27. }
  28. }

Report this snippet  

You need to login to post a comment.