Return to Snippet

Revision: 43651
at March 28, 2011 22:47 by thomykay


Updated Code
function Set-ResharperLoadFromRemoteSources
{
<#
	.SYNOPSIS
		Adds .NET4 loadFromRemoteSources to all Test Runner config files of Resharper.

	.DESCRIPTION
		This script may be needed if you execute tests from a share environment (i.e. Clearcase views).

	.NOTES
		Removes the Readonly attribute on the files that are applied with the ReSharper installation.
		Needs to run elevated.
#>

	[CmdletBinding()]
	param ()
	$programFilesX86 = &{if ([IntPtr]::Size -eq 8) {${env:ProgramFiles(x86)}} else {$env:ProgramFiles}}
	$files = (dir "$programFilesX86\JetBrains\ReSharper\v5.1\Bin\JetBrains.Resharper.TaskRunner*exe.config")
	$files| %{$_.Attributes = $_.Attributes -band (-bnot [IO.FileAttributes]::ReadOnly)}
	$files | %{
		[xml]$config = Get-Content $_.FullName
		$node = $config.CreateElement("loadFromRemoteSources")
		$node.Attributes.Append($config.CreateAttribute("enabled"))
		$node.enabled = "true"
		$config.configuration.runtime.AppendChild($node)
		$config.Save($_.FullName)
	}
}

Revision: 43650
at March 28, 2011 22:45 by thomykay


Initial Code
function Set-ResharperLoadFromRemoteSources
{
<#
	.SYNOPSIS
		Adds .NET4 loadFromRemoteSources to all Test Runner config files of Resharper.

	.DESCRIPTION
		This script may be needed if you execute tests from a share environment (i.e. Clearcase views).

	.NOTES
		Removes the Readonly attribute on the files that are applied with the ReSharper installation.

#>

	[CmdletBinding()]
	param ()
	$programFilesX86 = &{if ([IntPtr]::Size -eq 8) {${env:ProgramFiles(x86)}} else {$env:ProgramFiles}}
	$files = (dir "$programFilesX86\JetBrains\ReSharper\v5.1\Bin\JetBrains.Resharper.TaskRunner*exe.config")
	$files| %{$_.Attributes = $_.Attributes -band (-bnot [IO.FileAttributes]::ReadOnly)}
	$files | %{
		[xml]$config = Get-Content $_.FullName
		$node = $config.CreateElement("loadFromRemoteSources")
		$node.Attributes.Append($config.CreateAttribute("enabled"))
		$node.enabled = "true"
		$config.configuration.runtime.AppendChild($node)
		$config.Save($_.FullName)
	}
}

Initial URL


Initial Description


Initial Title
Set Resharper loadFromRemoteSources

Initial Tags


Initial Language
Windows PowerShell