![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | using named parameters in a SetScriptBlock (typedata) can I use named parameters in a SetScriptBlock ? Param([bool]$value) did not work, but $args -eq $true I don't realy like. for an example see http://mow001.blogspot.com/2006/07/p...ry-part-4.html Greetings /\/\o\/\/ |
My System Specs![]() |
| | #2 (permalink) |
| | Re: using named parameters in a SetScriptBlock (typedata) No - this is a limitation in V1 - you have to use $args. Now multivalued assignements can make this fairly painless (and familiar to Perl users :-) function foo { param($a, $b, $c) $a+$b+$c } becomes function foo { $a, $b, $c = $args $a+$b+$c } -bruce -- Bruce Payette [MSFT] Windows PowerShell Technical Lead Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "/\/\o\/\/" <no@spam.mow> wrote in message news:u5iOQbdqGHA.4508@TK2MSFTNGP04.phx.gbl... > can I use named parameters in a SetScriptBlock ? > Param([bool]$value) did not work, but $args -eq $true I don't realy like. > > for an example see > http://mow001.blogspot.com/2006/07/p...ry-part-4.html > > Greetings /\/\o\/\/ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Named parameters with Scope | PowerShell | |||
| Re: re-named folders by WLM | Live Mail | |||
| Update-TypeData usage | PowerShell | |||
| Some string typedata extensions | PowerShell | |||
| Using & operator not possible in typedata.ps1xml ? | PowerShell | |||