Please feel free to provide feedback or file bugs here.

Transfer $DebugPreference and $VerbosePreference to New-PSSession

I want a PSSessionOption that says to transfer over common applicable session level variables over to the remote session, specifically $DebugPreference and $VerbosePreference.
$DebugPreference = 'continue'
$PSSession = New-PSSession -ComputerName 'localhost'
Write-Debug $DebugPreference # Writes 'continue'
Invoke-Command -ScriptBlock {Write-Debug $DebugPreference} -Session $PSSession # Writes nothing

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    RansomingSQL shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base