commit a45781c66ee602831e2070feb9f0bf7355441bbd Author: Torste Brendgen Date: Mon Aug 18 21:30:35 2025 +0200 Initial commit diff --git a/Microsoft.SelfService.Portal.PowerShell.Domain.psd1 b/Microsoft.SelfService.Portal.PowerShell.Domain.psd1 new file mode 100644 index 0000000..091e95c --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Domain.psd1 @@ -0,0 +1,11 @@ +@{ + ModuleVersion = '1.0.0' + GUID = '48649ea8-ac30-430a-a3fd-fac192775c8a' + Author = 'Torsten Brendgen' + Description = 'Microsoft SelfService Portal Domain PowerShell Functions' + RootModule = 'Microsoft.SelfService.Portal.PowerShell.Domain.psm1' + FunctionsToExport = '*' + CmdletsToExport = @() + VariablesToExport = @() + AliasesToExport = @() +} \ No newline at end of file diff --git a/Microsoft.SelfService.Portal.PowerShell.Domain.psm1 b/Microsoft.SelfService.Portal.PowerShell.Domain.psm1 new file mode 100644 index 0000000..b3536de --- /dev/null +++ b/Microsoft.SelfService.Portal.PowerShell.Domain.psm1 @@ -0,0 +1,53 @@ +Import-Module -Name "Microsoft.SelfService.Portal.PowerShell.Core" -Force + +function Get-SSPDomains { + return $(Invoke-SSPRequest -Method Get -Endpoint "Domain") +} + +function Get-SSPDomainById { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Domain" -Query "Id/$Id") +} + +function Get-SSPDomainByName { + Param( + [System.String] $Name + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Domain" -Query "Name/$Name") +} + +function Get-SSPDomainByNetBIOS { + Param( + [System.String] $Name + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Domain" -Query "NetBIOS/$Name") +} + +function Get-SSPDomainByFQDN { + Param( + [System.String] $Name + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Domain" -Query "FQDN/$Name") +} + +function Get-SSPDomainEnvironments { + Param( + [System.Guid] $Id + ) + + return $(Invoke-SSPRequest -Method Get -Endpoint "Domain" -Query "$Id/Environments").environmentDomains.environment +} + +function New-SSPDomain { + Param( + [System.Collections.Hashtable] $Data + ) + + return $(Invoke-SSPRequest -Method Post -Endpoint "Domain" -Body $($Data | ConvertTo-JsonNewtonsoft)) +} \ No newline at end of file