6

LINQPad 如何多機共用 Queries、Snippets 與 Plugins and Extensions 資料夾

 2 years ago
source link: https://blog.miniasp.com/post/2022/03/09/LINQPad-Plugins-Queries-Snippets-share-between-multiple-machines
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

LINQPad 如何多機共用 Queries、Snippets 與 Plugins and Extensions 資料夾

LINQPad 有三個資料夾,預設放在使用者目錄的「我的文件」目錄下(~/Documents),分別是 LINQPad Plugins, LINQPad Queries, LINQPad Snippets 這三個。為了讓我的筆電與家中電腦可以同步這些資料,我特別將這幾個資料夾移至 Dropbox 共享資料夾中,然後透過 Symbolic Link 連結回去,如此一來我就不用特別調整 LINQPad 設定,我只要調整每台電腦的資料夾與連結設定,就可以很方便的讀取到同步後的 LINQPad 完整設定與資料。

我為了完成這個任務,特別寫了一個 PowerShell 模組,並且上架到 PowerShell Gallery,只要透過簡單的安裝,就可以立即執行,以下就是使用的方式:

  1. Install-Module linqpad-folders-powershell-module -Force
    

    若是要更新版本,可以使用以下命令:

    Update-Module linqpad-folders-powershell-module -Force
    
  2. 將 LINQPad 資料夾移至指定資料夾

    這裡的 -TargetPath 參數用來指定你希望儲存 LINQPad 設定的目標路徑,你必須先建立好該資料夾,才能執行以下命令:

    Set-LINQPadFolder -TargetPath '~/Dropbox/Tools/LINQPad'
    

    LINQPad Folders

    注意:在 Windows 下的 PowerShell 看的懂 ~ 符號,預設代表使用者家目錄,也就是以前在 Command Prompt 底下的 %USERPROFILE% 目錄。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK