public/Get-CTRecordingGeneral.ps1
Function Get-CTRecordingGeneral { [cmdletBinding( DefaultParameterSetName='Hanwha', #SupportsShouldProcess = $true, ConfirmImpact='high' )] Param( [Parameter( Mandatory=$true, ParameterSetName='Hanwha' )] [String]$IP, [Parameter( Mandatory=$true, ParameterSetName='Hanwha' )] [pscredential]$Credential, [Parameter( Mandatory=$true, ParameterSetName='Hanwha' )] [String]$Channel ) DynamicParam { $DynamicParameters = @{ CameraType = @{ Mandatory = $true Position = 1 ParameterSetName = "Hanwha" Enum = $Script:SupportedCameraModels } } return New-DynamicParameterSet -ParameterTable $DynamicParameters } Begin { Write-Debug "[Get-CTRecordingGeneral] Started" $CameraType = $PSBoundParameters.CameraType if($CameraType -eq 'Hanwha') { #Set basic Paramters for Invoke-HanwhaCommand $CamCmd = @{ Arguments = @{ IP = $IP Menu = 'recording' SubMenu = 'general' Action = 'view' Parameters = @() } Credential = $Credential } if($Channel) { $CamCmd.Arguments.Parameters += "Channel=$Channel" } return (Invoke-HanwhaCommand @CamCmd).RecordSetup } } } |