Skip to content

Commit

Permalink
Merge pull request #20 from ccp-aus/main
Browse files Browse the repository at this point in the history
Use correct info parameter and check for location
  • Loading branch information
homotechsual authored Apr 5, 2023
2 parents b3142d2 + 8e606ea commit b495c07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Public/Update/Update-NinjaOneLocation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ function Update-NinjaOneLocation {
$Resource = "v2/organization/$organisationId/locations/$locationId"
$RequestParams = @{
Resource = $Resource
Body = $deviceInformation
Body = $locationInformation
}
$OrganisationExists = (Get-NinjaOneOrganisations -OrganisationId $organisationId).Count -gt 0
$LocationExists = (Get-NinjaOneLocations -OrganisationId $organisationId -LocationId $locationId).Count -gt 0
$LocationExists = $(Get-NinjaOneLocations -OrganisationId $organisationId | Where-Object { $_.id -eq $locationId }).Count) -gt 0
if ($OrganisationExists -and $LocationExists) {
if ($PSCmdlet.ShouldProcess('Location information', 'Update')) {
$LocationUpdate = New-NinjaOnePATCHRequest @RequestParams
Expand Down

0 comments on commit b495c07

Please sign in to comment.