From 391157c773a18da70016057d42f96d362233565f Mon Sep 17 00:00:00 2001 From: Troy Harshberger Date: Wed, 4 Dec 2024 13:02:45 -0700 Subject: [PATCH] Remove auto-import. Didn't work. Move to function scope --- Modules/CIPPCore/Public/Set-PSAAssetDetail.ps1 | 2 ++ profile.ps1 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/CIPPCore/Public/Set-PSAAssetDetail.ps1 b/Modules/CIPPCore/Public/Set-PSAAssetDetail.ps1 index 41d6ccbd116e..e8489f8e2eac 100644 --- a/Modules/CIPPCore/Public/Set-PSAAssetDetail.ps1 +++ b/Modules/CIPPCore/Public/Set-PSAAssetDetail.ps1 @@ -9,6 +9,8 @@ function Set-PSAAssetDetail { $APIName = 'Set PSA Asset Detail' ) + Import-Module PS-NCentral + $MappingTable = Get-CIPPTable -TableName CippMapping $Table = Get-CIPPTable -TableName Extensionsconfig $Configuration = (Get-CIPPAzDataTableEntity @Table).config | ConvertFrom-Json -Depth 10 diff --git a/profile.ps1 b/profile.ps1 index a2c4fcbaeaaa..8ca5ffa7c0c5 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -13,7 +13,7 @@ # Remove this if you are not planning on using MSI or Azure PowerShell. # Import modules -@('PS-NCentral','CIPPCore', 'CippExtensions', 'Az.KeyVault', 'Az.Accounts') | ForEach-Object { +@('CIPPCore', 'CippExtensions', 'Az.KeyVault', 'Az.Accounts') | ForEach-Object { try { $Module = $_ Import-Module -Name $_ -ErrorAction Stop