IntelliTect / IntelliTect/PSToolbox

Invoke-ShouldProcess Closure concern?

Open
#65 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
10
Forks
4
PR merge metrics
No merged PRs in 30d

Description

When passing a script to `Invoke-ShouldProcess` if you assign a variable defined in the caller, will the variable get modified by the callee in the caller scope?

e.g.:
```
$output = $null
Invoke-ShouldProcess 'assign $output' {
$output = "This is a test"
}
$output | Should Be 'This is a test'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.