diff --git a/Scripts/Watch-Logfile.ps1 b/Scripts/Watch-Logfile.ps1 index da9a9edb2cf1f72435cfb49ed52ff5eedae398d8..a2d8dc11d095dd923a55c33d6424d418a8903542 100644 --- a/Scripts/Watch-Logfile.ps1 +++ b/Scripts/Watch-Logfile.ps1 @@ -1,3 +1,7 @@ +# Make sure to run from the directory containing the script itself: +$BaseDir = $(Split-Path $MyInvocation.MyCommand.Path) +Push-Location $BaseDir + $LocalConfiguration = ".\ScriptsConfig.ps1" if (Test-Path $LocalConfiguration) { . $LocalConfiguration @@ -13,4 +17,6 @@ if (Test-Path $LogFile) { Get-Content -Tail 20 -Wait $LogFile } else { Write-Host "Logfile '$LogFile' doesn't exist." -} \ No newline at end of file +} + +Pop-Location \ No newline at end of file