Added Data/ subfolder

This commit is contained in:
Markus Fleschutz 2020-12-14 14:06:09 +00:00
parent 83b57da820
commit 96caa52c07
7 changed files with 10 additions and 6 deletions

View File

Can't render this file because it is too large.

View File

@ -13,7 +13,9 @@ if ($City -eq "" ) {
try {
write-progress "Reading worldcities.csv..."
$Table = import-csv worldcities.csv
$PathToData=(get-item $MyInvocation.MyCommand.Path).directory
$PathToData="$PathToData/../Data"
$Table = import-csv "$PathToData/worldcities.csv"
$FoundOne = 0
foreach($Row in $Table) {
if ($Row.city -eq $City) {

View File

@ -1,4 +1,3 @@
#!/snap/bin/powershell
# Syntax: ./train-dns-cache.ps1
# Description: trains the DNS cache with frequently used domain names
@ -9,7 +8,10 @@
try {
$StartTime = Get-Date
$Table = import-csv domain_table.csv
$PathToData=(get-item $MyInvocation.MyCommand.Path).directory
$PathToData="$PathToData/../Data"
$Table = import-csv "$PathToData/domain_table.csv"
foreach($Row in $Table) {
$Domain = $Row.Domain
Write-Progress "Training DNS cache with $Domain..."

View File

@ -18,9 +18,9 @@ if ($TargetLanguage -eq "" ) {
}
try {
$PathToScript=(get-item $MyInvocation.MyCommand.Path).directory
$PathToScript="$PathToScript/trans"
Start-Process -FilePath $PathToScript -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
$PathToData=(get-item $MyInvocation.MyCommand.Path).directory
$PathToData="$PathToData/../Data"
Start-Process -FilePath "$PathToData/trans" -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
exit 0
} catch {
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"