commit eb7a07c027ce81bfb33e71a42965695c1675cd07 Author: Torsten Brendgen Date: Mon Apr 13 15:55:12 2026 +0200 Initial commit diff --git a/Microsoft.SelfService.Portal.PowerShell.Template.psd1 b/Microsoft.SelfService.Portal.PowerShell.Template.psd1 new file mode 100644 index 0000000..5c02926 --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Template.psd1 @@ -0,0 +1,11 @@ +@{ + ModuleVersion = '1.0.0' + GUID = 'fc5bd1d1-c958-46e2-a9a6-00eb047b4e9f' + Author = 'Torsten Brendgen' + Description = 'Microsoft SelfService Portal Domain PowerShell Functions' + RootModule = 'Microsoft.SelfService.Portal.PowerShell.Template.psm1' + FunctionsToExport = '*' + CmdletsToExport = @() + VariablesToExport = @() + AliasesToExport = @() +} \ No newline at end of file diff --git a/Microsoft.SelfService.Portal.PowerShell.Template.psm1 b/Microsoft.SelfService.Portal.PowerShell.Template.psm1 new file mode 100644 index 0000000..c15c8a9 --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Template.psm1 @@ -0,0 +1,69 @@ +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)) +} \ No newline at end of file