Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • PowerShell 2.0: One Cmdlet at a Time #32 Exit-PSSession

    Posted on January 7th, 2010 Jonathan Medd No comments

    Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Exit-PSSession cmdlet.

    What can I do with it?

    Exit an interactive PowerShell session that has been opened on a computer which has been enabled for PowerShell remoting.

    Example:

    Leave an interactive PowerShell session with a computer which has been enabled for PowerShell remoting.

    Exit-PSSession

    You will notice that the prompt has changed back from

    [test01]: PS C:\>

    to simply

    PS C:\>

    Exit-PSSession

    Tip: When in an interactive remote session you can also just type Exit to finish the session.

    How could I have done this in PowerShell 1.0?

    Remoting did not exist in PowerShell 1.0, you would have needed to use Remote Desktop to run an interactive session on a remote server.

    1000 things 1% better!

    Leave a reply