diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md index 54263cb6a2db..a3e3df20800a 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md @@ -6,7 +6,6 @@ online version: https://docs.microsoft.com/powershell/module/microsoft.powershel schema: 2.0.0 title: about_Remote_Variables --- - # About Remote Variables ## Short description @@ -78,7 +77,7 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {Get-WinEvent -LogName $Using:ps} ``` -A variable reference such as `$using:var` expands to the value of variable `$var` +A variable reference such as `$using:var` expands to the value of variable `$var` from the caller's context. You do not get access to the caller's variable object. The `Using` scope modifier cannot be used to modify a local variable within the **PSSession**. For example, the following code does not work: @@ -89,6 +88,8 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {$Using:ps = 'Cannot assign new value'} ``` +For more information about `Using`, see [about_Scopes](./about_Scopes.md) + ### Using splatting PowerShell splatting passes a collection of parameter names and values to a diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Remote_Variables.md b/reference/6/Microsoft.PowerShell.Core/About/about_Remote_Variables.md index c34ef29e04ae..8a9df50c0241 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Remote_Variables.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Remote_Variables.md @@ -6,7 +6,6 @@ online version: https://docs.microsoft.com/powershell/module/microsoft.powershel schema: 2.0.0 title: about_Remote_Variables --- - # About Remote Variables ## Short description @@ -78,7 +77,7 @@ Invoke-Command -ComputerName S1 -ScriptBlock { } ``` -A variable reference such as `$using:var` expands to the value of variable `$var` +A variable reference such as `$using:var` expands to the value of variable `$var` from the caller's context. You do not get access to the caller's variable object. The `Using` scope modifier cannot be used to modify a local variable within the **PSSession**. For example, the following code does not work: @@ -89,6 +88,8 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {Get-WinEvent -LogName $Using:ps} ``` +For more information about `Using`, see [about_Scopes](./about_Scopes.md) + ### Using splatting PowerShell splatting passes a collection of parameter names and values to a diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Remote_Variables.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Remote_Variables.md index 9add73cca0d0..bdcf4eb5a41d 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Remote_Variables.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Remote_Variables.md @@ -6,7 +6,6 @@ online version: https://docs.microsoft.com/powershell/module/microsoft.powershel schema: 2.0.0 title: about_Remote_Variables --- - # About Remote Variables ## Short description @@ -78,7 +77,7 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {Get-WinEvent -LogName $Using:ps} ``` -A variable reference such as `$using:var` expands to the value of variable `$var` +A variable reference such as `$using:var` expands to the value of variable `$var` from the caller's context. You do not get access to the caller's variable object. The `Using` scope modifier cannot be used to modify a local variable within the **PSSession**. For example, the following code does not work: @@ -89,6 +88,8 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {$Using:ps = 'Cannot assign new value'} ``` +For more information about `Using`, see [about_Scopes](./about_Scopes.md) + ### Using splatting PowerShell splatting passes a collection of parameter names and values to a diff --git a/reference/7.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md b/reference/7.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md index e4f7f98ff529..72dee3240a7d 100644 --- a/reference/7.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md +++ b/reference/7.1/Microsoft.PowerShell.Core/About/about_Remote_Variables.md @@ -6,7 +6,6 @@ online version: https://docs.microsoft.com/powershell/module/microsoft.powershel schema: 2.0.0 title: about_Remote_Variables --- - # About Remote Variables ## Short description @@ -78,7 +77,7 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {Get-WinEvent -LogName $Using:ps} ``` -A variable reference such as `$using:var` expands to the value of variable `$var` +A variable reference such as `$using:var` expands to the value of variable `$var` from the caller's context. You do not get access to the caller's variable object. The `Using` scope modifier cannot be used to modify a local variable within the **PSSession**. For example, the following code does not work: @@ -89,6 +88,8 @@ $ps = "*PowerShell*" Invoke-Command -Session $s -ScriptBlock {$Using:ps = 'Cannot assign new value'} ``` +For more information about `Using`, see [about_Scopes](./about_Scopes.md) + ### Using splatting PowerShell splatting passes a collection of parameter names and values to a