Trying to create a function like the following:

```
Function Get-SqlErrorLogPrevious24 {
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory=$True,Position=1)]
        [Microsoft.SqlServer.Management.Smo.Server]$Server
    )

    ($Server.ReadErrorLog()).where{$_.logdate -ge ((Get-Date).AddHours(-24))}
}

```

What I've noticed though, is that I can pass in just a string and not a Server object. 

Is there a way in Powershell to strongly enforce the data type being passed in or will it always implicitly convert a string to an SMO object?