Skip to content

Commit

Permalink
Cleanup logging and other debugging tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
Troy Harshberger committed Dec 5, 2024
1 parent df6b7c4 commit f19a2e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modules/CIPPCore/Public/Set-PSAAssetDetail.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Set-PSAAssetDetail {

try {
$managedCompanies = Get-AutotaskManaged -CIPPMapping $MappingTable
Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Got $($managedCompanies.ManagedCusts.Count) managed companies." -Sev "Info"
#Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Got $($managedCompanies.ManagedCusts.Count) managed companies." -Sev "Info"

#Get all AT Configuration Items of type workstation, that are active, that have the "N-central Device ID [UDF]" property set, and Managed
#Get-AutotaskAPIResource -Resource ConfigurationItemTypes -SimpleSearch "isactive eq $true "
Expand Down Expand Up @@ -76,7 +76,7 @@ function Set-PSAAssetDetail {
#Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Connected to N-Central." -Sev "Info"

$ATDevices = Get-AutotaskAPIResource -Resource ConfigurationItems -SearchQuery $query
Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Got $($ATDevices.Count) Autotask devices." -Sev "Info"
#Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Got $($ATDevices.Count) Autotask devices." -Sev "Info"

foreach ($ATDevice in $ATDevices){
#get the NC device info using the "N-central Device ID [UDF]""
Expand All @@ -86,7 +86,7 @@ function Set-PSAAssetDetail {
#$NCDevice = Get-NCDeviceID "TNS-HYPERV1" | Get-NCDeviceObject
$NCDevice = Get-NCDeviceObject $NCid

Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Updating $($ATDevices.IndexOf($ATDevice)+1)/$($ATDevices.Count)" -Sev "Info"
#Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Updating $($ATDevices.IndexOf($ATDevice)+1)/$($ATDevices.Count)" -Sev "Info"

$body = [PSCustomObject]@{
userDefinedFields = @(
Expand Down Expand Up @@ -120,6 +120,6 @@ function Get-NCentralJWT {
$ClientSecret = $ENV:NCentralJWT
}

Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Got NCentral api key $($ClientSecret.substring(0,5))..." -Sev "Info"
#Write-LogMessage -user "CIPP" -API $APIName -tenant "None" -Message "Got NCentral api key $($ClientSecret.substring(0,5))..." -Sev "Info"
return $ClientSecret
}

0 comments on commit f19a2e5

Please sign in to comment.