Pass By Reference Parameters

There are 1 entries for the tag Pass By Reference Parameters

Pass by Reference Parameters in PowerShell

A long time ago Jeffrey Snover briefly mentioned the PowerShell [REF] parameter attribute, but otherwise there isn’t much mention around about how to use it. It seems simple enough, but I kept getting this error from PowerShell: “Reference type is expected in argument.” This post by MOW cleared things up for me – I needed to wrap my [REF] parameters in parens in the function call, like so: Find-NewMessages $valvar1 ([REF]$refvar1) ([REF]$refvar2) For those looking to see how pass by reference params...

Posted On Wednesday, January 14, 2009 5:06 PM | Feedback (3)

Copyright © Lance Robinson

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski