Do powershell parameters need to be at the front of the script? <p>I'm trying to have a script with both executable code and a function, like the following: </p> <pre><code>function CopyFiles { Param( ... ) ... } // Parameter for the script param ( ... ) // Executable code </code></pre> <p>However, I run into the following error: "The assignment expression is not valid. The input to an assignment operator must be an object that is able to accept assignments, such as a variable or a property"</p> <p>When I list my function at the end of the file, it says that the function name is undefined. How do I call a powershell function from executable code within the same script? </p>