-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
204 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cmdlets | ||
HaloAPI |
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 @@ | ||
Changelog |
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 @@ | ||
{"rule":"EN_A_VS_AN","sentence":"^\\QSwitch from using \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q to \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q to fix the actual issue in GitHub #1\nAdd an \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q parameter to \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q for non-standard authentication routes.\\E$"} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"cSpell.words": [ | ||
"PWSH", | ||
"Testand" | ||
] | ||
{ | ||
"cSpell.words": [ | ||
"authinfo", | ||
"PWSH", | ||
"Testand" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,66 +1,107 @@ | ||
# Changelog | ||
|
||
* 2022-02-06 | ||
## 2023-03-10 - Version 1.14.0 | ||
|
||
Version 1.7.0 - Refactored error handling. | ||
* Add Custom Table endpoints `Get-HaloCustomTable`, `New-HaloCustomTable`, `Remove-HaloCustomTable`. | ||
|
||
* 2022-02-03 | ||
## 2023-01-01 - Version 1.13.2 | ||
|
||
* Fix incorrect pluralization of `Get-HaloCustomField`. | ||
* Changes to pipeline and release process. | ||
|
||
## 2023-01-01 - Version 1.13.1 | ||
|
||
* Added `IncludeTenants` Switch to `Get-HaloAzureADConnection` to fix Contact sync script. | ||
|
||
Version 1.7.0-beta1 - Fixed authentication bug - Fixed token expiry calculation. | ||
## 2022-11-18 - Version 1.13.0 | ||
|
||
* 2022-01-04 | ||
* Adds `Recover-HaloTicket` and `-Deleted` parameter for `Get-HaloTicket`. | ||
* Fix `429` (API rate limiting) response handling. | ||
* Refactor of 429 error handling. | ||
* Increase batch wait to 30 seconds. | ||
* Adds `Remove-HaloItem`. | ||
|
||
Version 1.5.0 - New Feature: Added Workday functions | ||
## 2022-09-16 - Version 1.11.1 | ||
|
||
* 2021-11-11 | ||
* Fix for `PostedOnly` and `NonPostedOnly` parameters on `Get-HaloInvoice`. | ||
|
||
Version 1.4.0 - Fixed: Bug in Get-HaloAsset where some parameters were in the incorrect set. - Fixed: Bug in the token expiry calculation causing too many reconnects. - Fixed: Bug in authentication to trial instances. - Fixed: Bug in billing templates. - New Feature: Added Recurring invoice functions. | ||
## 2022-07-02 - Version 1.10.1 | ||
|
||
* 2021-09-03 | ||
* Fix incorrect bug fix reversion affecting batch cmdlets. | ||
|
||
Version 1.3.0-Beta5 - Fixes the authentication flow for trial instances. Starts adding pipeline support (Tickets/Actions currently). | ||
## 2022-07-01 - Version 1.10.0 | ||
|
||
* 2021-08-25 | ||
* Internal contract change, `Invoke-HaloBatchProcessor` now uses `BatchInput` instead of `Input`. Bugfixes for batch processing. | ||
|
||
Version 1.3.0-Beta4 - Uses the `api/authinfo` endpoint to dynamically populate the Authentication URL for all requests now. | ||
## 2022-06-21 - Version 1.9.1 | ||
|
||
* 2021-08-25 | ||
* Add `-FullObject` parameter for Sites, batch processing for Actions, Workflows, Custom Fields and expose `Invoke-HaloRequest` for ad hoc requests. | ||
|
||
Version 1.3.0-Beta3 - Handle `-AuthURL` with or without a path. | ||
## 2022-03-23 - Version 1.9.0 | ||
|
||
* 2021-08-25 | ||
* Adds Software Licences, Asset Types and new automated tests. | ||
|
||
Version 1.3.0-Beta2 - Switch from using `-AuthPath` to `-AuthURL` to fix the actual issue in GitHub #1 | ||
## 2022-03-15 - Version 1.8.0 | ||
|
||
* 2021-08-25 | ||
* Handle arrays of objects for many New/Set commands. | ||
|
||
Version 1.3.0-Beta1 - Add an `-AuthPath` parameter to Connect-HaloAPI for non-standard authentication routes. | ||
## 2022-02-06 - Version 1.7.0 | ||
|
||
* 2021-08-24 | ||
* Refactored error handling. | ||
|
||
Version 1.2.3 - Fix misnamed function invocation in `Get-HaloClient`. | ||
## 2022-01-04 - Version 1.5.0 | ||
|
||
* 2021-08-24 | ||
* New Feature: Added Workday functions | ||
|
||
Version 1.2.2 - Remove the attempt to load the `HaloLookup` class in HaloAPI.psm1 as it's not used. | ||
## 2021-11-11 - Version 1.4.0 | ||
|
||
* 2021-08-23 | ||
* Fixed: Bug in `Get-HaloAsset` where some parameters were in the incorrect set. | ||
* Fixed: Bug in the token expiry calculation causing too many reconnects. | ||
* Fixed: Bug in authentication to trial instances. | ||
* Fixed: Bug in billing templates. | ||
* New Feature: Added Recurring invoice functions. | ||
|
||
Version 1.2.1 - Adds missing classes which were erroneously excluded from the build script. | ||
## 2021-10-01 - Version 1.3.2 | ||
|
||
* 2021-08-22 | ||
* Fixed: Token expiry calculation is now correct. | ||
|
||
Version 1.2.0 - Changes to error handling for more descriptive and reliable error messages. - Adds validation and dynamic completion classes for Lookups, Custom Button types and Scopes. - Add Custom Buttons endpoint. | ||
## 2021-10-01 - Version 1.3.1 | ||
|
||
* 2021-08-12 | ||
* Fixes the authentication flow for trial instances. Starts adding pipeline support (Tickets/Actions currently). | ||
* Uses the `api/authinfo` endpoint to dynamically populate the Authentication URL for all requests now. | ||
* Handle `-AuthURL` with or without a path. | ||
* Switch from using `-AuthPath` to `-AuthURL` to fix the actual issue in GitHub #1 | ||
* Add an `-AuthPath` parameter to `Connect-HaloAPI` for non-standard authentication routes. | ||
|
||
Version 1.1.0 - Change to output formats - now outputs the objects/results directly. No more `(Get-HaloAction).actions`. - Add the first two `Remove-` commands. - Leaner more efficient core. | ||
## 2021-08-24 - Version 1.2.3 | ||
|
||
* 2021-08-11 | ||
* Fix misnamed function invocation in `Get-HaloClient`. | ||
|
||
Version 1.0.2 - Fix a bug with `Get-HaloAsset` when supplying the `AssetID` parameter. | ||
## 2021-08-24 - Version 1.2.2 | ||
|
||
* 2021-08-08 | ||
|
||
Version 1.0.1 - Initial release of the HaloAPI PowerShell module. | ||
* Remove the attempt to load the `HaloLookup` class in `HaloAPI.psm1` as it's not used. | ||
|
||
## 2021-08-23 - Version 1.2.1 | ||
|
||
* Adds missing classes which were erroneously excluded from the build script. | ||
|
||
## 2021-08-22 - Version 1.2.0 | ||
|
||
* Changes to error handling for more descriptive and reliable error messages. | ||
* Adds validation and dynamic completion classes for Lookups, Custom Button types and Scopes. | ||
* Add Custom Buttons endpoint. | ||
|
||
## 2021-08-12 - Version 1.1.0 | ||
|
||
* Change to output formats - now outputs the objects/results directly. No more `(Get-HaloAction).actions`. | ||
* Add the first two `Remove-` commands. | ||
* Leaner more efficient core. | ||
|
||
## 2021-08-11 - Version 1.0.2 | ||
|
||
* Fix a bug with `Get-HaloAsset` when supplying the `AssetID` parameter. | ||
|
||
## 2021-08-08 - Version 1.0.1 | ||
|
||
* Initial release of the HaloAPI PowerShell module. | ||
|
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,47 @@ | ||
#Requires -Version 7 | ||
function Get-HaloCustomTable { | ||
<# | ||
.SYNOPSIS | ||
Gets custom tables from the Halo API. | ||
.DESCRIPTION | ||
Retrieves custom tables from the Halo API - supports a variety of filtering parameters. | ||
.OUTPUTS | ||
A powershell object containing the response. | ||
#> | ||
[CmdletBinding( DefaultParameterSetName = 'Multi' )] | ||
[OutputType([Object])] | ||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '', Justification = 'Uses dynamic parameter parsing.')] | ||
Param( | ||
# Custom Table ID. | ||
[Parameter( ParameterSetName = 'Single', Mandatory = $True )] | ||
[int64]$CustomTableId | ||
) | ||
Invoke-HaloPreFlightCheck | ||
$CommandName = $MyInvocation.MyCommand.Name | ||
$Parameters = (Get-Command -Name $CommandName).Parameters | ||
# Workaround to prevent the query string processor from adding an 'customtableid=' parameter by removing it from the set parameters. | ||
if ($CustomTableId) { | ||
$Parameters.Remove('CustomTableId') | Out-Null | ||
} | ||
$QSCollection = New-HaloQuery -CommandName $CommandName -Parameters $Parameters | ||
try { | ||
if ($AgentID) { | ||
Write-Verbose "Running in single-custom table mode because '-CustomTableId' was provided." | ||
$Resource = "api/customtable/$($CustomTableId)" | ||
} else { | ||
Write-Verbose 'Running in multi-custom button mode.' | ||
$Resource = 'api/customtable' | ||
} | ||
$RequestParams = @{ | ||
Method = 'GET' | ||
Resource = $Resource | ||
AutoPaginateOff = $True | ||
QSCollection = $QSCollection | ||
ResourceType = 'customtables' | ||
} | ||
$CustomTableResults = New-HaloGETRequest @RequestParams | ||
Return $CustomTableResults | ||
} 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,25 @@ | ||
Function New-HaloCustomTable { | ||
<# | ||
.SYNOPSIS | ||
Creates a custom table via the Halo API. | ||
.DESCRIPTION | ||
Function to send a custom table creation request to the Halo API | ||
.OUTPUTS | ||
Outputs an object containing the response from the web request. | ||
#> | ||
[CmdletBinding( SupportsShouldProcess = $True )] | ||
[OutputType([Object])] | ||
Param ( | ||
# Object containing properties and values used to create a new custom table. | ||
[Parameter( Mandatory = $True )] | ||
[Object]$CustomTable | ||
) | ||
Invoke-HaloPreFlightCheck | ||
try { | ||
if ($PSCmdlet.ShouldProcess("Custom Table '$($CustomTable.ctname)'", 'Create')) { | ||
New-HaloPOSTRequest -Object $CustomTable -Endpoint 'customtable' | ||
} | ||
} 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,33 @@ | ||
function Remove-HaloKBArticle { | ||
<# | ||
.SYNOPSIS | ||
Removes a knowledgebase articles from the Halo API. | ||
.DESCRIPTION | ||
Deletes a specific knowledgebase articles from Halo. | ||
.OUTPUTS | ||
A powershell object containing the response. | ||
#> | ||
[cmdletbinding( SupportsShouldProcess = $True, ConfirmImpact = 'High' )] | ||
[OutputType([Object])] | ||
Param( | ||
# The KBArticle ID | ||
[Parameter( Mandatory = $True )] | ||
[Alias('KBArticle')] | ||
[int64]$KBArticleID | ||
) | ||
Invoke-HaloPreFlightCheck | ||
try { | ||
$ObjectToDelete = Get-HaloKBArticle -KBArticleID $KBArticleID | ||
if ($ObjectToDelete) { | ||
if ($PSCmdlet.ShouldProcess("KBArticleID '$($ObjectToDelete.name)')'", 'Delete')) { | ||
$Resource = "api/KBArticle/$($KBArticleID)" | ||
$ClientResults = New-HaloDELETERequest -Resource $Resource | ||
Return $ClientResults | ||
} | ||
} else { | ||
Throw 'Knowledgebase article was not found in Halo to delete.' | ||
} | ||
} catch { | ||
New-HaloError -ErrorRecord $_ | ||
} | ||
} |