public/Get-CTNumOfChannels.ps1
Function Get-CTNumOfChannels { [cmdletBinding( #DefaultParameterSetName='Preset', #SupportsShouldProcess = $true, ConfirmImpact='high' )] Param( [Parameter( Mandatory=$true )] [String]$IP, [Parameter( Mandatory=$true )] [pscredential]$Credential ) DynamicParam { $DynamicParameters = @{ CameraType = @{ Mandatory = $true Position = 1 ParameterSetName = "All" Enum = $Script:SupportedCameraModels } } return New-DynamicParameterSet -ParameterTable $DynamicParameters } Begin { Write-Debug "[Get-CTNumOfChannels] Started" $CameraType = $PSBoundParameters.CameraType #Build Submission Object $obj = @{ IP = $IP Credential = $Credential } #Choose Camera Model Switch ($CameraType) { Hanwha { return Get-HanwhaNumOfChannels -Object $obj } } } } |