-
Notifications
You must be signed in to change notification settings - Fork 0
/
getRecognitionAssets.ps1
68 lines (49 loc) · 2.39 KB
/
getRecognitionAssets.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Set-PSDebug -Trace 1
$shell_app=new-object -com shell.application
$destination = $shell_app.namespace("$PSScriptRoot")
if (-not[System.IO.File]::Exists("$PSScriptRoot\recognition-assets\conf\diagram.conf") -Or
-not[System.IO.File]::Exists("$PSScriptRoot\recognition-assets\conf\raw-content.conf") -Or
-not[System.IO.File]::Exists("$PSScriptRoot\recognition-assets\conf\math.conf") -Or
-not[System.IO.File]::Exists("$PSScriptRoot\recognition-assets\conf\en_US.conf"))
{
if ( Test-Path "$PSScriptRoot\recognition-assets")
{
Remove-Item "$PSScriptRoot\recognition-assets\*" -Recurse
}
# Download myscript-iink-recognition-math.zip
$clnt = new-object System.Net.WebClient
$url = "https://s3-us-west-2.amazonaws.com/iink/assets/1.3.0/myscript-iink-recognition-math.zip"
$file = "$PSScriptRoot\myscript-iink-recognition-math.zip"
$clnt.DownloadFile($url,$file)
# Unzip myscript-iink-recognition-math.zip
$zip_file = $shell_app.namespace($file)
$destination.Copyhere($zip_file.items(),16)
Remove-Item $file
# Download myscript-iink-recognition-diagram.zip
$clnt = new-object System.Net.WebClient
$url = "https://s3-us-west-2.amazonaws.com/iink/assets/1.3.0/myscript-iink-recognition-diagram.zip"
$file = "$PSScriptRoot\myscript-iink-recognition-diagram.zip"
$clnt.DownloadFile($url,$file)
# Unzip myscript-iink-recognition-diagram.zip
$zip_file = $shell_app.namespace($file)
$destination.Copyhere($zip_file.items(),16)
Remove-Item $file
# Download myscript-iink-recognition-raw-content.zip
$clnt = new-object System.Net.WebClient
$url = "https://s3-us-west-2.amazonaws.com/iink/assets/1.3.0/myscript-iink-recognition-raw-content.zip"
$file = "$PSScriptRoot\myscript-iink-recognition-raw-content.zip"
$clnt.DownloadFile($url,$file)
# Unzip myscript-iink-recognition-raw-content.zip
$zip_file = $shell_app.namespace($file)
$destination.Copyhere($zip_file.items(),16)
Remove-Item $file
# Download myscript-iink-recognition-text-en_US.zip
$clnt = new-object System.Net.WebClient
$url = "https://s3-us-west-2.amazonaws.com/iink/assets/1.3.0/myscript-iink-recognition-text-en_US.zip"
$file = "$PSScriptRoot\myscript-iink-recognition-text-en_US.zip"
$clnt.DownloadFile($url,$file)
# Unzip myscript-iink-recognition-text-en_US.zip
$zip_file = $shell_app.namespace($file)
$destination.Copyhere($zip_file.items(),16)
Remove-Item $file
}