Initial commit
This commit is contained in:
47
Microsoft.SelfService.Portal.PowerShell.Service.psm1
Normal file
47
Microsoft.SelfService.Portal.PowerShell.Service.psm1
Normal file
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user