mirror of
https://github.com/KelvinTegelaar/RunAsUser.git
synced 2026-04-26 09:05:56 +03:00
[PR #6] [MERGED] Tidy up PInvoke code and use elevated token if possible #4
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/RunAsUser#4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/KelvinTegelaar/RunAsUser/pull/6
Author: @jborean93
Created: 7/15/2020
Status: ✅ Merged
Merged: 7/16/2020
Merged by: @KelvinTegelaar
Base:
master← Head:pinvoke📝 Commits (1)
d057205Tidy up PInvoke code and use elevated token if possible📊 Changes
2 files changed (+315 additions, -177 deletions)
View changed files
📝
Public/Invoke-AsCurrentUser.ps1(+12 -5)📝
runasuser.psm1(+303 -172)📄 Description
This makes a few changes. These changes are technically changes in behaviour
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe-ErrorActionbehaviour defined by the callerThe following are "bugfixes"
-bypassexecutionpolicywhich wasn't correct because it was seen as the module name and not an arg-bypassexecutionpolicyto be-ExecutionPolicy BypassStartProcessAsCurrentUserreturn the process id in case that is needed in the futureWTSFreeMemorywas called as the current code caused a memory leak, albiet a minor oneFixes https://github.com/KelvinTegelaar/RunAsUser/issues/3
I was personally unable to actually run anything even with the old code due to it trying to start up on the interactive desktop. For testing I had to comment out
github.com/KelvinTegelaar/RunAsUser@d057205e35/runasuser.psm1 (L308)but I assume this behaviour is desired for RMM. Please let me know if you have any issues with the changes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.