Skip to content

Commit

Permalink
Fix broken parameter in New-NinjaOneOrganisation.
Browse files Browse the repository at this point in the history
  • Loading branch information
homotechsual committed Oct 25, 2023
1 parent 6da2841 commit 0d5d8d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2023-10-25 - Version 1.12.3

* Fix broken template policy id parameter handling in `New-NinjaOneOrganisation`.

## 2023-10-25 - Version 1.12.2

* Add missing aliases for various other `*organisation*` parameters.
Expand Down
4 changes: 2 additions & 2 deletions NinjaOne.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = '.\NinjaOne.psm1'

# Version number of this module.
ModuleVersion = '1.12.2'
ModuleVersion = '1.12.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -269,7 +269,7 @@
IconUri = 'https://pbs.twimg.com/profile_images/1452496768030187521/kIGQii5Y_400x400.jpg'

# ReleaseNotes of this module
ReleaseNotes = 'Add missing parameter aliases.'
ReleaseNotes = 'Fix broken template policy id parameter handling in New-NinjaOneOrganisation.'

# Prerelease string of this module
# Prerelease = 'Beta1'
Expand Down
10 changes: 10 additions & 0 deletions Public/New/New-NinjaOneOrganisation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ function New-NinjaOneOrganisation {
[switch]$show
)
try {
$CommandName = $MyInvocation.InvocationName
$Parameters = (Get-Command -Name $CommandName).Parameters
if ($organisation) {
$Parameters.Remove('organisation') | Out-Null
}
if ($show) {
$Parameters.Remove('show') | Out-Null
}
$QSCollection = New-NinjaOneQuery -CommandName $CommandName -Parameters $Parameters
$Resource = 'v2/organizations'
$RequestParams = @{
Resource = $Resource
Body = $organisation
QSCollection = $QSCollection
}
if ($PSCmdlet.ShouldProcess("Organisation '$($organisation.name)'", 'Create')) {
$OrganisationCreate = New-NinjaOnePOSTRequest @RequestParams
Expand Down

0 comments on commit 0d5d8d4

Please sign in to comment.