Skip to content

Commit

Permalink
Sync the .NET working path for Powershell sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed May 23, 2023
1 parent afb31b0 commit ed5d516
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/msf/core/post/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed5d516

Please sign in to comment.