-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process is killed when PowerShell exits #5
Comments
Start-AppBackgroundTask requires a GUID of the task to be performed. |
Receive-Job -Job $job The term 'pause-process' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. + CategoryInfo : ObjectNotFound: (pause-process:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException + PSComputerName : localhost Invoke-Command -ScriptBlock {Start-Job -ScriptBlock {pause-process -ID 1288}} Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 5 Job5 BackgroundJob Running True localhost pause-process -ID 1288 Did not successfully pause PID 1288. Both of these methods would have been problematic due to the requirement that pause-process would have to be loaded as a local module for each session. |
What if you execute the code remotely without ever spawning powershell.exe in the first place? Would that change anything? |
Take another look at Kansa. They've added asynchronity and powershell spawning. Watch out for EDR-freak-outs! |
If a process is being paused by Pause-Process, the Powershell session that invoked Pause-Process needs to remain open for the process to continue to be paused. Once the session exits, the paused process is then terminated.
The text was updated successfully, but these errors were encountered: