Last active
August 29, 2015 14:27
-
-
Save pedropombeiro/1de1fb725cd3136af15c to your computer and use it in GitHub Desktop.
Setup LINQPad with Dropbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$queriesPath = "$linqpadDir\Queries" | |
$snippetsPath = "$linqpadDir\Snippets" | |
if (-not (Test-Path "$env:APPDATA\LINQPad")) { | |
[Void] (mkdir "$env:APPDATA\LINQPad") | |
} | |
$linqpadDir = "$HOME\Dropbox\Briefcase\Personal\Code\LINQPad" | |
$queriesPath | Out-File "$env:APPDATA\LINQPad\querypath.txt" -Encoding ASCII | |
$queriesPath | Out-File "$env:APPDATA\LINQPad\QueryLocations.txt" -Encoding ASCII | |
$snippetsPath | Out-File "$env:APPDATA\LINQPad\SnippetLocations.txt" -Encoding ASCII | |
$xml = [xml](Get-Content "$env:APPDATA\LINQPad\RoamingUserOptions.xml") | |
$customSnippetsFolder = xml.UserOptions.CustomSnippetsFolder | |
if ($customSnippetsFolder -eq $null) { | |
$customSnippetsFolder = $xml.CreateElement("CustomSnippetsFolder", "http://schemas.datacontract.org/2004/07/LINQPad") | |
$customSnippetsFolder.InnerText= $snippetsPath | |
$xml.UserOptions.AppendChild($customSnippetsFolder) | |
} | |
else { | |
$xml.UserOptions.CustomSnippetsFolder = $snippetsPath | |
} | |
$xml.Save("$env:APPDATA\LINQPad\RoamingUserOptions.xml") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment