"Param" must come first within a function.
I think all you'd need to do was to package the script so that the code in your "myscript.ps1" file becomes a function (with a meaningful name) inside a PS1 file. The class(es) can then appear after the script file's "param" set and before the function(s).
This just a cobbled together example:
Param($something)
class Foo {
[int]$int
[double]$dou
[string]$str
Foo([int]$p){
$this.int = $p
}
Foo([double]$p){
$this.dou = $p
}
Foo([string]$p){
$this.str = $p
}
}
# the code that does the work
Function MyStuff{
param(
[Foo]$Bar
)
$Bar
}
# driver
MyStuff $something