how can i add more than one function within a script and then call them by entering parameters? for example in the code below it meants to change configuration in the local area connection so i would like to call the function like so SscriptNAme -Change 192.168.0.1, 255.255.255.255, 192.168.0.2. and I want to have other functions within the same script that i would also like to call by entering parameters:
function Change{
$S=$executionContext.InvokeCommand.NewScriptBlock("netsh interface ip set address name = 'Local Area Connection' source=static addr=$args[0] mask=$args[1] gateway=$args[2] gwmetric=0")
}
function ChangeOne{
$S=$executionContext.InvokeCommand.NewScriptBlock("netsh interface ip set address name = 'Local Area Connection' source=static addr=$args[0] mask=$args[1] gateway=$args[2] gwmetric=0")
}
can someone tell me if im in the right direction and give me some pointers on how to do it. thanks