diff --git a/Animelibk.ps1 b/Animelibk.ps1 index 5026623..1dd3911 100644 --- a/Animelibk.ps1 +++ b/Animelibk.ps1 @@ -35,8 +35,8 @@ $RegexpSet = { } if ($VarConfig) { - if (Test-Path $VarConfig) { - $T = Get-Content -Encoding UTF8 $VarConfig | % { $H = @{} ; $S = $null} { + if (Test-Path $PSScriptRoot\$VarConfig) { + $T = Get-Content -Encoding UTF8 $PSScriptRoot\$VarConfig | % { $H = @{} ; $S = $null} { if ($_ -match "^\[(?\w*)\]" ) { $S = $Matches["T"] $H.add($S, @()) @@ -47,8 +47,8 @@ if ($VarConfig) { $T.GetEnumerator() | % { Set-Variable -Name $_.name -Value $_.value} } else { &$RegexpSet - $EpisodeRegex | % {"[EpisodeRegex]"}{ """$_""" }{""} | Out-File -Encoding UTF8 $VarConfig - $NameRegex | % {"[NameRegex]"}{ """$_""" } | Out-File -Encoding UTF8 -Append $VarConfig + $EpisodeRegex | % {"[EpisodeRegex]"}{ """$_""" }{""} | Out-File -Encoding UTF8 $PSScriptRoot\$VarConfig + $NameRegex | % {"[NameRegex]"}{ """$_""" } | Out-File -Encoding UTF8 -Append $PSScriptRoot\$VarConfig } } else {