diff --git a/MFASweep.ps1 b/MFASweep.ps1 index da4bf95..7dafb7e 100644 --- a/MFASweep.ps1 +++ b/MFASweep.ps1 @@ -1161,7 +1161,7 @@ Function Write-TokensToFile { ) if ($WriteTokens) { - $tokenFilePath = "$PSScriptRoot\AccessTokens.json" + $tokenFilePath = Join-Path ("$PSScriptRoot" ? "$PSScriptRoot" : ".") "AccessTokens.json" $currentDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss" # Create the new token entry @@ -1199,7 +1199,7 @@ Function Write-CookiesToFile { [string]$UserAgent ) - $tokenFilePath = "$PSScriptRoot\AccessTokens.json" + $tokenFilePath = Join-Path ("$PSScriptRoot" ? "$PSScriptRoot" : ".") "AccessTokens.json" $currentDate = Get-Date -Format "yyyy-MM-dd HH:mm:ss" # Prepare cookie data