Skip to content

adds link to about_scopes #5587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down