public/Get-CTDNSSettings.ps1
#https://$($ip)/stw-cgi/network.cgi?msubmenu=dns&action=set&Type=Manual&PrimaryDNS=10.119.3.254&SecondaryDNS=10.119.3.254 Function Get-CTDNSSettings { [cmdletBinding( DefaultParameterSetName='All', #SupportsShouldProcess = $true, ConfirmImpact='high' )] Param( [Parameter( Mandatory=$true, ParameterSetName='All' )] [String]$IP, [Parameter( Mandatory=$true, ParameterSetName='All' )] [pscredential]$Credential, [Parameter( Mandatory=$false, ParameterSetName='All' )] [String]$PrimaryDNS, [Parameter( Mandatory=$false, ParameterSetName='All' )] [String]$SecondaryDNS ) DynamicParam { $DynamicParameters = @{ CameraType = @{ Mandatory = $true Position = 1 ParameterSetName = "All" Enum = $Script:SupportedCameraModels } } return New-DynamicParameterSet -ParameterTable $DynamicParameters } Begin { Write-Debug "[Get-CTDNSSettings] Started" $CameraType = $PSBoundParameters.CameraType if($CameraType -eq 'Hanwha') { #Set basic Paramters for Invoke-HanwhaCommand $CamCmd = @{ Arguments = @{ IP = $IP Menu = 'network' SubMenu = 'dns' Action = 'view' Parameters = @() } Credential = $Credential } return (Invoke-HanwhaCommand @CamCmd).DNS } } } |