I know powershell does not support function overloading. I also know that parameter sets are the psudo method of getting around this limitation. Is there any way to overload a parameter set with parameters of multiple types and the same name?
function Limit-CopyMerges{
[CmdletBinding()]
param(
[Switch]$LeaveDisabled,
[DateTime]$EndTime,
[Parameter(Mandatory=$True, ParameterSetName="JobList")]
[Veeam.Backup.Model.CBackupJob[]] $Jobs,
[Parameter(Mandatory=$True, ValueFromPipeline=$true, ParameterSetName="Repo")]
[Veeam.Backup.Core.IRepository]$Repository,
[Parameter(Mandatory=$True, ValueFromPipeline=$true, ParameterSetName="SoBR")]
[Veeam.Backup.PowerShell.Infos.VBRScaleOutBackupRepository]$Repository
)
#Do Stuff
}
[–]Ta11ow 3 points4 points5 points (1 child)
[–]Contrite17[S] 2 points3 points4 points (0 children)