Skip to content

Instantly share code, notes, and snippets.

@pedropombeiro
Last active August 29, 2015 14:27
Show Gist options
  • Save pedropombeiro/1de1fb725cd3136af15c to your computer and use it in GitHub Desktop.
Save pedropombeiro/1de1fb725cd3136af15c to your computer and use it in GitHub Desktop.
Setup LINQPad with Dropbox
$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