Public/MIT/New-MITFolder.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function New-MITFolder
{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string]$Id,
        [Parameter(Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string]$Name,
        [ValidateSet('None','CopyOnly','Always')]
        [string]$InheritPermissions
    )

    $body = Convert-PSBoundToRequestBody $PSBoundParameters -KeysToExclude 'Id'
    $response = Invoke-MITRequest -Method 'Post' -Resource "folders/$Id/subfolders" -Body $body
    Write-MITOutput -Response $response -Typename "MIREST.MITFolderSimple"
}