private/Functions/Hanwha/Format-HanwhaSDCard.ps1
#https://$($ip)/stw-cgi/system.cgi?msubmenu=storageinfo&action=control&Storage=1&Mode=Format Function Format-HanwhaSDCard { [cmdletBinding()] Param( [Parameter()] [hashtable]$Object ) <# Object Definition: @{ IP = [String(Mandatory)] Credential = [PSCredential(Mandatory)] Storage = [int] as [String(Optional)] } #> #Set basic Paramters for Invoke-HanwhaCommand $CamCmd = @{ Arguments = @{ IP = $Object.IP Menu = 'system' SubMenu = 'storageinfo' Action = 'control' Parameters = @() } Credential = $Object.Credential } #Add Action Parameters $CamCmd.Arguments.Parameters += "Mode=Format" if($Object.ContainsKey('Storage')) { $CamCmd.Arguments.Parameters += "Storage=$($Object.Storage)" } else { $CamCmd.Arguments.Parameters += "Storage=1" } #Command will not return data if successful return Invoke-HanwhaCommand @CamCmd } |