[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

multiple parameters within powershell

Posted on 2013-02-06
3
Medium Priority
?
368 Views
Last Modified: 2013-02-06
Hi im looking to set 2 parameters within this function. I have $setrecieveconnector  but also want to change the IP to a param. Whats the best way to go about it. Thanks

function setrecieveconnector {
param(
    [Parameter(Mandatory=$true)]
    $setrecieveconnector
set-ReceiveConnector -Name 'Default $setrecieveconnector' -Bindings '172.31.90.101:25'
}
0
Comment
Question by:cwstad2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
coraxal earned 1000 total points
ID: 38858774
You can try this:
 
function setrecieveconnector {
	param
	(
	[Parameter(Mandatory=$true,Position=0)]
	[string]
	$setrecieveconnector,
	[Parameter(Mandatory=$true,Position=1)]
	[string]
	$IPAddress
	)	
	set-ReceiveConnector -Name "Default $setrecieveconnector" -Bindings "$IPAddress:25"
}

Open in new window

0
 
LVL 40

Assisted Solution

by:Subsun
Subsun earned 1000 total points
ID: 38858778
Try..
function setrecieveconnector {
param(
    [Parameter(Mandatory=$true)]
    $setrecieveconnector,
    $ip
)
set-ReceiveConnector -Name "Default $($setrecieveconnector)" -Bindings "$($ip):25"
}

Open in new window

0
 
LVL 15

Author Closing Comment

by:cwstad2
ID: 38859091
thanks
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question