Update README.md

This commit is contained in:
m-kovalsky 2021-06-17 10:06:06 +03:00 committed by GitHub
parent 12dd889889
commit 2f3f00dd1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,12 +27,19 @@ Following these steps will automatically load the Best Practice Rules into your
3. Run the following code in the Advanced Scripting window. 3. Run the following code in the Advanced Scripting window.
```C# ```C#
using System.Windows.Forms;
System.Net.WebClient w = new System.Net.WebClient(); System.Net.WebClient w = new System.Net.WebClient();
string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData); string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
string url = "https://raw.githubusercontent.com/microsoft/Analysis-Services/master/BestPracticeRules/BPARules.json"; string url = "https://raw.githubusercontent.com/microsoft/Analysis-Services/master/BestPracticeRules/BPARules.json";
string version = Application.ProductVersion.Substring(0,1);
string downloadLoc = path+@"\TabularEditor\BPARules.json"; string downloadLoc = path+@"\TabularEditor\BPARules.json";
if (version == "3")
{
downloadLoc = path+@"\TabularEditor3\BPARules.json";
}
w.DownloadFile(url, downloadLoc); w.DownloadFile(url, downloadLoc);
``` ```