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