-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.12.0-Beta1 - Recover, Deleted and 429 fixes.
- Loading branch information
1 parent
062463d
commit 46b4009
Showing
36 changed files
with
483 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function Remove-HaloUser { | ||
<# | ||
.SYNOPSIS | ||
Removes a user from the Halo API. | ||
.DESCRIPTION | ||
Deletes a specific user from Halo. | ||
.OUTPUTS | ||
A powershell object containing the response. | ||
#> | ||
[cmdletbinding( SupportsShouldProcess = $True, ConfirmImpact = 'High' )] | ||
[OutputType([Object])] | ||
Param( | ||
# The Ticket ID | ||
[Parameter( Mandatory = $True )] | ||
[Alias('User')] | ||
[int64]$UserId | ||
) | ||
Invoke-HaloPreFlightCheck | ||
try { | ||
$ObjectToDelete = Get-HaloUser -UserId $UserId | ||
if ($ObjectToDelete) { | ||
if ($PSCmdlet.ShouldProcess("User '$($ObjectToDelete.name)')'", 'Delete')) { | ||
$Resource = "api/users/$($UserId)" | ||
$UserResults = New-HaloDELETERequest -Resource $Resource | ||
Return $UserResults | ||
} | ||
} else { | ||
Throw 'User was not found in Halo to delete.' | ||
} | ||
} catch { | ||
New-HaloError -ErrorRecord $_ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
function Restore-HaloTicket { | ||
<# | ||
.SYNOPSIS | ||
Restores a ticket using the Halo API. | ||
.DESCRIPTION | ||
Restores a specific ticket or array of tickets from Halo. | ||
.OUTPUTS | ||
A powershell object containing the response. | ||
#> | ||
[cmdletbinding( SupportsShouldProcess = $True, ConfirmImpact = 'High' )] | ||
[OutputType([Object])] | ||
Param( | ||
# The Ticket id or array of ticket ids. | ||
[Parameter( Mandatory = $True )] | ||
[Alias('Ticket')] | ||
[int64[]]$TicketId | ||
) | ||
Invoke-HaloPreFlightCheck | ||
try { | ||
$Tickets = [System.Collections.Generic.List[Object]] | ||
$TicketId | ForEach-Object { | ||
$Tickets.Add( | ||
@{ | ||
id = $_.id | ||
_recover = $True | ||
_validate_updates = $True | ||
} | ||
) | ||
} | ||
if ($PSCmdlet.ShouldProcess($Tickets -is [Array] ? 'Tickets' : 'Ticket', 'Update')) { | ||
Set-HaloTicket -Object $Tickets | ||
} | ||
} catch { | ||
New-HaloError -ErrorRecord $_ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.