From the properties pane of your VB.NET script you should go to select “Files” and right click to “Add File”.

Next you need to create a module or class which will contain the custom function. In the example below I have created a function which generates a random number based on a set of minimum and maximum parameters.

Finally you can then call the random function in the main module of your VB.NET script which executes your test case.