Import-Module -Name "Microsoft.SelfService.Portal.PowerShell.Core" -Force function Get-SSPTemplates { return $(Invoke-SSPRequest -Method Get -Endpoint "Template") } function Get-SSPTemplateCategories { return $(Invoke-SSPRequest -Method Get -Endpoint "TemplateCategory") } function Get-SSPTemplateOptions { return $(Invoke-SSPRequest -Method Get -Endpoint "TemplateOption") } function Get-SSPTemplateById { Param( [System.Guid] $Id ) return $(Invoke-SSPRequest -Method Get -Endpoint "Template" -Query "Id/$Id") } function Get-SSPTemplateByName { Param( [System.String] $Name ) return $(Invoke-SSPRequest -Method Get -Endpoint "Template" -Query "Name/$Name") } function Get-SSPTemplateCategoryById { Param( [System.Guid] $Id ) return $(Invoke-SSPRequest -Method Get -Endpoint "TemplateCategory" -Query $Id) } function Get-SSPTemplateOptionsById { Param( [System.Guid] $Id ) return $(Invoke-SSPRequest -Method Get -Endpoint "TemplateOption" -Query "Id/$Id") } function New-SSPTemplate { Param( [System.Collections.Hashtable] $Data ) return $(Invoke-SSPRequest -Method Post -Endpoint "Template" -Body $($Data | ConvertTo-JsonNewtonsoft)) } function New-SSPTemplateCategory { Param( [System.Collections.Hashtable] $Data ) return $(Invoke-SSPRequest -Method Post -Endpoint "TemplateCategory" -Body $($Data | ConvertTo-JsonNewtonsoft)) } function New-SSPTemplateOption { Param( [System.Collections.Hashtable] $Data ) return $(Invoke-SSPRequest -Method Post -Endpoint "TemplateOption" -Body $($Data | ConvertTo-JsonNewtonsoft)) }