From 45a8b1ac4e094988b5cca5b80f79870cdd9ff61a Mon Sep 17 00:00:00 2001 From: Torste Brendgen Date: Mon, 18 Aug 2025 21:31:22 +0200 Subject: [PATCH] Initial commit --- ....SelfService.Portal.PowerShell.Option.psd1 | 11 +++++ ....SelfService.Portal.PowerShell.Option.psm1 | 49 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Microsoft.SelfService.Portal.PowerShell.Option.psd1 create mode 100644 Microsoft.SelfService.Portal.PowerShell.Option.psm1 diff --git a/Microsoft.SelfService.Portal.PowerShell.Option.psd1 b/Microsoft.SelfService.Portal.PowerShell.Option.psd1 new file mode 100644 index 0000000..dbe5245 --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Option.psd1 @@ -0,0 +1,11 @@ +@{ + ModuleVersion = '1.0.0' + GUID = '26095a51-7cd2-49df-846e-44b0b7c49098' + Author = 'Torsten Brendgen' + Description = 'Microsoft SelfService Portal Domain PowerShell Functions' + RootModule = 'Microsoft.SelfService.Portal.PowerShell.Option.psm1' + FunctionsToExport = '*' + CmdletsToExport = @() + VariablesToExport = @() + AliasesToExport = @() +} \ No newline at end of file diff --git a/Microsoft.SelfService.Portal.PowerShell.Option.psm1 b/Microsoft.SelfService.Portal.PowerShell.Option.psm1 new file mode 100644 index 0000000..1b5e13a --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Option.psm1 @@ -0,0 +1,49 @@ +Import-Module -Name "Microsoft.SelfService.Portal.PowerShell.Core" -Force + +function Get-SSPOptions { + return $(Invoke-SSPRequest -Method Get -Endpoint "Option") +} + +function Get-SSPOptionCategories { + return $(Invoke-SSPRequest -Method Get -Endpoint "OptionCategory") +} + +function Get-SSPOptionById { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Option" -Query "Id/$Id") +} + +function Get-SSPOptionByName { + Param( + [System.String] $Name + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Option" -Query "Name/$Name") +} + +function Get-SSPOptionCategoryById { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "OptionCategory" -Query $Id) +} + +function New-SSPOption { + Param( + [System.Collections.Hashtable] $Data + ) + + return $(Invoke-SSPRequest -Method Post -Endpoint "Option" -Body $($Data | ConvertTo-JsonNewtonsoft)) +} + +function New-SSPOptionCategory { + Param( + [System.Collections.Hashtable] $Data + ) + + return $(Invoke-SSPRequest -Method Post -Endpoint "OptionCategory" -Body $($Data | ConvertTo-JsonNewtonsoft)) +} \ No newline at end of file