mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-24 02:48:17 +02: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 {
|
try {
|
||||||
write-progress "Reading worldcities.csv..."
|
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
|
$FoundOne = 0
|
||||||
foreach($Row in $Table) {
|
foreach($Row in $Table) {
|
||||||
if ($Row.city -eq $City) {
|
if ($Row.city -eq $City) {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#!/snap/bin/powershell
|
|
||||||
|
|
||||||
# Syntax: ./train-dns-cache.ps1
|
# Syntax: ./train-dns-cache.ps1
|
||||||
# Description: trains the DNS cache with frequently used domain names
|
# Description: trains the DNS cache with frequently used domain names
|
||||||
@ -9,7 +8,10 @@
|
|||||||
try {
|
try {
|
||||||
$StartTime = Get-Date
|
$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) {
|
foreach($Row in $Table) {
|
||||||
$Domain = $Row.Domain
|
$Domain = $Row.Domain
|
||||||
Write-Progress "Training DNS cache with $Domain..."
|
Write-Progress "Training DNS cache with $Domain..."
|
||||||
|
@ -18,9 +18,9 @@ if ($TargetLanguage -eq "" ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$PathToScript=(get-item $MyInvocation.MyCommand.Path).directory
|
$PathToData=(get-item $MyInvocation.MyCommand.Path).directory
|
||||||
$PathToScript="$PathToScript/trans"
|
$PathToData="$PathToData/../Data"
|
||||||
Start-Process -FilePath $PathToScript -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
Start-Process -FilePath "$PathToData/trans" -ArgumentList "-i $SourceFile -s $SourceLanguage -t $TargetLanguage -e google -brief" -NoNewWindow -Wait
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user