Skip to content

Instantly share code, notes, and snippets.

@nicholasdille
Created September 22, 2017 12:40
Show Gist options
  • Save nicholasdille/bbee4dc6506319df32a68929c4fd42ad to your computer and use it in GitHub Desktop.
Save nicholasdille/bbee4dc6506319df32a68929c4fd42ad to your computer and use it in GitHub Desktop.
PowerShell Sessions
$SessionOption = New-PSSessionOption -OutputBufferingMode Drop -IdleTimeout (60*60*2*1000)
Invoke-Command -ComputerName Server2 -SessionOption $SessionOption -InDisconnectedSession -Name MySession
Get-Session
$MySession = Get-Session -ComputerName Server2
Enter-PSSession -Session $MySession
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment