From b3e98da62b02a0492fec1048f2fbb207577a2851 Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Mon, 13 Apr 2026 16:03:26 +0200 Subject: [PATCH] Initial commit --- ...SelfService.Portal.PowerShell.Service.psd1 | 11 +++++ ...SelfService.Portal.PowerShell.Service.psm1 | 47 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 Microsoft.SelfService.Portal.PowerShell.Service.psd1 create mode 100644 Microsoft.SelfService.Portal.PowerShell.Service.psm1 diff --git a/Microsoft.SelfService.Portal.PowerShell.Service.psd1 b/Microsoft.SelfService.Portal.PowerShell.Service.psd1 new file mode 100644 index 0000000..ccac4ca --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Service.psd1 @@ -0,0 +1,11 @@ +@{ + ModuleVersion = '1.0.0' + GUID = '7760faec-afd1-4ecc-8353-23249ac6e024' + Author = 'Torsten Brendgen' + Description = 'Microsoft SelfService Portal Domain PowerShell Functions' + RootModule = 'Microsoft.SelfService.Portal.PowerShell.Service.psm1' + FunctionsToExport = '*' + CmdletsToExport = @() + VariablesToExport = @() + AliasesToExport = @() +} \ No newline at end of file diff --git a/Microsoft.SelfService.Portal.PowerShell.Service.psm1 b/Microsoft.SelfService.Portal.PowerShell.Service.psm1 new file mode 100644 index 0000000..b878bec --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Service.psm1 @@ -0,0 +1,47 @@ +Import-Module -Name "Microsoft.SelfService.Portal.PowerShell.Core" -Force + +function Get-SSPServices { + return $(Invoke-SSPRequest -Method Get -Endpoint "Service") +} + +function Get-SSPServiceById { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Service" -Query "Name/$Id") +} + +function Get-SSPServiceByName { + [CmdletBinding()] + Param( + [System.String] $Name + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Service" -Query "Name/$Name") +} + +function New-SSPService { + Param( + [System.Collections.Hashtable] $Data + ) + + return $(Invoke-SSPRequest -Method Post -Endpoint "Service" -Body $($Data | ConvertTo-JsonNewtonsoft)) +} + +function Set-SSPService { + Param( + [System.Guid] $Id, + [System.Collections.Hashtable] $Data + ) + + return $(Invoke-SSPRequest -Method Put -Endpoint "Service" -Query $Id -Body $($Data | ConvertTo-JsonNewtonsoft)) +} + +function Remove-SSPService { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Delete -Endpoint "Service" -Query $Id) +} \ No newline at end of file