Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 18-02-2009
Member
 
Join Date: Jan 2009
Posts: 36
Calling a function with arguments or parameter in Powershell?

Hi,

I don't understand the difference between the parameter & arguments in the powershell while calling a function?

Can you guys please help me understanding the basic difference & the advantages or disadvantages?
Reply With Quote
  #2  
Old 18-02-2009
Member
 
Join Date: Jan 2009
Posts: 19
Re: Calling a function with arguments or parameter in Powershell?

Well I don't think there is much difference between the two methods of calling a function! But its your personal liking about your style!

You can call function both ways!

Hope this helps!
Reply With Quote
  #3  
Old 18-02-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Calling a function with arguments or parameter in Powershell?

Dealing with Parameters in Powershell

This is a link where you understand function with parameters!
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #4  
Old 18-02-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Calling a function with arguments or parameter in Powershell?

PowerShell is a bit funky.. When you create a function and you want to supply parameters, the following format applies:

function fname {

param([string]$a, [int]$b) # the two parameters.

write-host ("a = " + $a)

write-host ("b = " + $b)

}
Reply With Quote
  #5  
Old 18-02-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Calling a function with arguments or parameter in Powershell?

This is what I think you will find it more helpful!

http://powershelllive.com/blogs/lunc...-vbscript.aspx
and
http://poshoholic.com/2007/10/06/pow...ion-or-script/

Hope this helps!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Calling a function with arguments or parameter in Powershell?"
Thread Thread Starter Forum Replies Last Post
Parameter function and generic pointer Rubero Software Development 7 25-09-2010 09:04 PM
Pointer parameter in a function Chrisch Software Development 4 14-12-2009 10:57 PM
Passing arguments to a function Aman 1 Software Development 3 09-12-2009 01:11 PM
Matrix parameter function Chrisch Software Development 3 02-12-2009 11:07 AM
Function with a variable number of arguments Chrisch Software Development 3 20-11-2009 02:03 PM


All times are GMT +5.5. The time now is 09:11 PM.