diff --git a/lib/msf/core/post/file.rb b/lib/msf/core/post/file.rb index a06fe282c7fc..051f2d46d3eb 100644 --- a/lib/msf/core/post/file.rb +++ b/lib/msf/core/post/file.rb @@ -49,7 +49,7 @@ def cd(path) if session.type == 'meterpreter' session.fs.dir.chdir(e_path) elsif session.type == 'powershell' - cmd_exec("Set-Location -Path \"#{e_path}\"") + cmd_exec("Set-Location -Path \"#{e_path}\";[System.IO.Directory]::SetCurrentDirectory($(Get-Location))") else session.shell_command_token("cd \"#{e_path}\"") end