commit a4834f003d068708c1ee08fd9a06b572df95d2c6 Author: Torsten Brendgen Date: Mon Apr 13 15:52:15 2026 +0200 Initial commit diff --git a/Microsoft.SelfService.Portal.PowerShell.Environment.psd1 b/Microsoft.SelfService.Portal.PowerShell.Environment.psd1 new file mode 100644 index 0000000..029b97f --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Environment.psd1 @@ -0,0 +1,11 @@ +@{ + ModuleVersion = '1.0.0' + GUID = '48649ea8-ac30-430a-a3fd-fac192775c8a' + Author = 'Torsten Brendgen' + Description = 'Microsoft SelfService Portal Environment PowerShell Functions' + RootModule = 'Microsoft.SelfService.Portal.PowerShell.Environment.psm1' + FunctionsToExport = '*' + CmdletsToExport = @() + VariablesToExport = @() + AliasesToExport = @() +} \ No newline at end of file diff --git a/Microsoft.SelfService.Portal.PowerShell.Environment.psm1 b/Microsoft.SelfService.Portal.PowerShell.Environment.psm1 new file mode 100644 index 0000000..0d4a22b --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Environment.psm1 @@ -0,0 +1,37 @@ +Import-Module -Name "Microsoft.SelfService.Portal.PowerShell.Core" -Force + +function Get-SSPEnvironments { + return $(Invoke-SSPRequest -Method Get -Endpoint "Environment") +} + +function Get-SSPEnvironmentById { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Environment" -Query "Id/$Id") +} + +function Get-SSPEnvironmentByName { + Param( + [System.String] $Name + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Environment" -Query "Name/$Name") +} + +function Get-SSPEnvironmentDomains { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Environment" -Query "$Id/Environments").environmentDomains.environment +} + +function New-SSPEnvironment { + Param( + [System.Collections.Hashtable] $Data + ) + + return $(Invoke-SSPRequest -Method Post -Endpoint "Environment" -Body $($Data | ConvertTo-JsonNewtonsoft)) +} \ No newline at end of file