A sample from your script would highly help in giving you an accurate answer. That said, here is a generic answer that shows a script with functions and without functions in PowerShell.
Function Sum {
Param ([int]$a,[int]$b)
return $a+$b
}
So, when you have this in a script, you dot source the script. So, you can call the function directly from cmdline. For example
Sum 4 5
will return 9.
Now, without functions, let us say sum.ps1 has the following code:
Param ([int]$a,[int]$b)
$a+$b
You can call, .\sum.ps1 4 5
at the console or whereever, and it returns 9 again.
It is not necessary to use param()
at all. You can use $args array to retrieve the parameters. But, it makes sense to bind parameters to a type and give them a name using Param()