Skip to content

Commit

Permalink
Update about_Remote_Variables.md (MicrosoftDocs#4482)
Browse files Browse the repository at this point in the history
Line 45 adjusted to execute in same PSsession.
  • Loading branch information
dacarroll authored and sdwheeler committed Jun 26, 2019
1 parent 063c3ce commit 726a2f4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ remote variable must be defined in the same PSSession.

```powershell
$s = New-PSSession -ComputerName S1
Invoke-Command -ComputerName S1 -ScriptBlock {$ps = "Windows PowerShell"}
Invoke-Command -Sessions $s -ScriptBlock {$ps = "Windows PowerShell"}
Invoke-Command -Sessions $s -ScriptBlock {Get-WinEvent -LogName $ps}
```

Expand Down Expand Up @@ -121,4 +121,4 @@ Invoke-Command -ComputerName S1 -ScriptBlock {

[Enter-PSSession](../Enter-PSSession.md)

[New-PSSession](../New-PSSession.md)
[New-PSSession](../New-PSSession.md)

0 comments on commit 726a2f4

Please sign in to comment.