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