Differences with Enter-PSSession
See original GitHub issueWhen using pypsrp
to start a session, there are some different to a session started with Enter-PSSession
.
For example, using the Set-PSDebug
or Trace-Command
cmdlets seems to have no effect. And similarly, output from a script in a JEA role capabilities file configured using ScriptsToProcess
does not come through to any of the session streams – such as the output from Write-Host "Hello world"
.
Is this a scoping issue or some other session configuration option that I have overlooked?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Enter-PSSession vs New-PSSession : r/PowerShell - Reddit
Enter -PSSession: Starts a temporary interactive session with a remote computer. You can have only one interactive session at a time using Enter- ......
Read more >Enter-PSSession - PowerShell - Microsoft Learn
This command starts an interactive session on the local computer. The command prompt changes to indicate that you are now running commands in...
Read more >Enter-PSSession: Running Remote Commands in Interactive ...
The Enter-PSSession and New-PSSession cmdlets create a persistent one-to-one remote session and are used mostly in interactive scenarios. If you ...
Read more >powershell - enter-pssession invoke-command, when to use?
New-PSSession - creates a persistent connection to a remote server and is generally used when you have a series of commands to run...
Read more >Enter-PSSession - PowerShell - SS64.com
You can pipe a value for ComputerName. When the remote computer is in a different domain, use a fully qualified domain name. -ConfigurationName...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I figured out how to make it work:
That is, the equivalent of
Set-PSDebug -Trace 1 | Invoke-Job1
.If I use
ps.add_statement()
before the second cmdlet, it stops working – I’m thinking that must be a scoping issue.That’s interesting that you couldn’t have it span across statements as essentially the
add_script
example in mine was doing the same thing… It sounds like you’ve got a decent workaround and the problem was on the server side not respective the setting in the previous statement.