mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 07:53:21 +01:00
Added Data/ subfolder
This commit is contained in:
parent
83b57da820
commit
96caa52c07
Can't render this file because it is too large.
|
@ -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) {
|
||||
|
@ -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..."
|
||||
|
@ -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])"
|
||||
|
Loading…
Reference in New Issue
Block a user