The cmdlet does not work in Windows PowerShell, only in PowerShell 6+.
It should also work in Windows PowerShell 5.1 (or at least give a notification on that it doesn't work in Windows PowerShell
C:\...> New-AzDoServiceConnection @Parameters -Verbose -AzDoConnectionName ...
VERBOSE: Starting Function New-AzDoServiceConnection
VERBOSE: Scope set: /subscriptions/...
VERBOSE: No start date provided - using the current time as default.
VERBOSE: No value specified for -EndDate parameter; setting the value to one year after start date.
VERBOSE: No application id provided - created new AD application with application id '...'
WARNING: Assigning role 'owner' over scope '/subscriptions/...' to the new service principal.
VERBOSE: Role assignment with role 'owner' and scope '/subscriptions/...' successfully created
for the created service principal.
VERBOSE: Created ServicePrincipal example
VERBOSE: GET https://dev.azure.com/.../_apis/projects?api-version=6.0 with 0-byte payload
VERBOSE: received 537-byte response of content type application/json; charset=utf-8; api-version=6.0
VERBOSE: Collected Azure DevOps Projects
VERBOSE: Collected ID: ...
ConvertFrom-SecureString : A parameter cannot be found that matches parameter name 'AsPlainText'.
At C:\Users\...\WindowsPowerShell\Modules\NewAzDoServiceConnection\0.0.3\NewAzDoServiceConnection.psm1:178 char:92
+ ... = ($ServicePrincipal.Secret | ConvertFrom-SecureString -AsPlainText)
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [ConvertFrom-SecureString], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.ConvertFromSecureStringCommand
VERBOSE: Creating Connection
VERBOSE: POST https://dev.azure.com/.../.../_apis/serviceendpoint/endpoints?api-version=6.0-preview.4 with
0-byte payload
Could not create Connection: Value cannot be null.
Parameter name: endpoint
At C:\...\Documents\WindowsPowerShell\Modules\NewAzDoServiceConnection\0.0.3\NewAzDoServiceConnection.psm1:209 char:9
+ Throw "Could not create Connection: $($ErrorMessage.message)"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Could not creat... name: endpoint:String) [], RuntimeException
+ FullyQualifiedErrorId : Could not create Connection: Value cannot be null.
Parameter name: endpoint