Logo

dev-resources.site

for different kinds of informations.

Powershell closures

Published at
7/7/2020
Categories
original
shorts
dev
Author
pitermarx
Categories
3 categories in total
original
open
shorts
open
dev
open
Author
9 person written this
pitermarx
open
Powershell closures

As a follow up to the previous article, I needed to warn you (and me) about powershell closures. They didn’t work as i expected

The confusion point for me was that $Foo can be changed by the invoker, unless we add the .GetNewClosure().

As in the previous article the parameter name $ResourceGroupName is very common, it’s best to always use the .GetNewClosure() on the ScriptBlock

Featured ones: