Josh King 2/28/2020

It's Likely We're Living in a PSSession

Read Original

This technical blog post addresses a question from the PowerShell community about determining if code is executing within a remote PSSession and how to retrieve the connection's identifying information. It details the use of the $PSSenderInfo automatic variable, which exists only in a PSSession, and demonstrates how to extract the hostname from the ConnectionString property using a System.Uri object for reliable server identification in automated scripts.

It's Likely We're Living in a PSSession

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week