Public/Set-HuduFolder.ps1
function Set-HuduFolder { Param ( [Parameter(Mandatory=$true)] [Int]$id ='', [Parameter(Mandatory=$true)] [String]$name, [String]$icon='', [String]$description='', [Int]$parent_folder_id='', [Int]$company_id='' ) $folder = [ordered]@{folder = [ordered]@{}} $folder.folder.add('name',$name) if ($icon) { $folder.folder.add('icon',$icon) } if ($description) { $folder.folder.add('description',$description) } if ($parent_folder_id) { $folder.folder.add('parent_folder_id',$parent_folder_id) } if ($company_id) { $folder.folder.add('company_id',$company_id) } $json = $folder | convertto-json $response = Invoke-HuduRequest -Method put -Resource "/api/v1/folders/$id" -body $json $response } |