private/Functions/Axis/Set-AxisRecordingGeneral.ps1
Function Set-AxisRecordingGeneral { [cmdletBinding()] Param( [Parameter()] [hashtable]$Object ) <# Object Definition: @{ IP = [String(Mandatory)] Credential = [PSCredential(Mandatory)] Storage = [int] as [String(Optional)] } #> #Set basic Paramters for Invoke-AxisCommand $CamCmd = @{ Arguments = @{ IP = $Object.IP Menu = 'recording' SubMenu = 'general' Action = 'set' Parameters = @() } Credential = $Object.Credential } $Channel = 0 if($Object.Channel) { $Channel = $Object.Channel } #Add Action Parameters $CamCmd.Arguments.Parameters += "Channel=$($Channel)" if($Object.Continuous) { $CamCmd.Arguments.Parameters += "NormalMode=$($Object.Continuous)" } if($Object.PreEventDuration) { if($Object.PreEventDuration -match '[A-Za-z]') { $CamCmd.Arguments.Parameters += "PreEventDuration=$($Object.PreEventDuration)" } else { $CamCmd.Arguments.Parameters += "PreEventDuration=$($PreEventDuration)s" } } if($Object.PostEventDuration) { if($Object.PostEventDuration -match '[A-Za-z]') { $CamCmd.Arguments.Parameters += "PostEventDuration=$PostEventDuration" } else { $CamCmd.Arguments.Parameters += "PostEventDuration=$($PostEventDuration)s" } } if($Object.FileType) { $CamCmd.Arguments.Parameters += "RecordedVideoFileType=$($Object.FileType)" } #If event isn't set, use the value from Continuous if($Object.CamEvent) { $CamCmd.Arguments.Parameters += "EventMode=$($Object.CamEvent)" } elseif ($Object.Continuous) { $CamCmd.Arguments.Parameters += "EventMode=$($Object.Continuous)" } Invoke-AxisCommand @CamCmd } |