From 4651f4dfafc85ba383ecefa7890a83f12d1569f0 Mon Sep 17 00:00:00 2001 From: m-kovalsky Date: Thu, 4 Feb 2021 19:12:46 +0200 Subject: [PATCH] Update README.md updated the c# script to fetch the BPARules from GitHub to be more robust. --- BestPracticeRules/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/BestPracticeRules/README.md b/BestPracticeRules/README.md index 94a837a..83ece34 100644 --- a/BestPracticeRules/README.md +++ b/BestPracticeRules/README.md @@ -16,12 +16,13 @@ Following these steps will automatically load the Best Practice Rules into your 2. Connect to a model. 3. Run the following code in the Advanced Scripting window. - System.Net.WebClient w = new System.Net.WebClient(); - - string userName = System.Environment.UserName; + System.Net.WebClient w = new System.Net.WebClient(); + + string userName = System.Environment.UserName; + string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData); string url = "https://raw.githubusercontent.com/microsoft/Analysis-Services/master/BestPracticeRules/BPARules.json"; - string downloadLoc = @"C:\Users\"+userName+@"\AppData\Local\TabularEditor\BPARules.json"; - + string downloadLoc = path+@"\TabularEditor\BPARules.json"; + w.DownloadFile(url, downloadLoc); 4. Close and reopen [Tabular Editor](https://tabulareditor.com/ "Tabular Editor").