Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 28, 2025

This PR implements the ability to load lazy properties for CCM classes, starting with the Get-CCMApplication function.

Problem

Configuration Manager classes like CCM_Application use lazy-loaded properties such as AppDTs (deployment types) that are not populated in initial CIM queries. These properties contain important information but require additional queries to load, resulting in performance implications.

Solution

Added a new -IncludeLazyProperties switch parameter to Get-CCMApplication that enables lazy property loading when needed:

# Standard usage (no change in behavior)
Get-CCMApplication -ApplicationName "7-Zip"

# Load lazy properties including AppDTs (deployment types) 
Get-CCMApplication -ApplicationName "7-Zip" -IncludeLazyProperties

# Works with filtering and remote computers
Get-CCMApplication -ApplicationID "ScopeId_12345" -ComputerName "RemotePC" -IncludeLazyProperties

Implementation Details

  • When -IncludeLazyProperties is specified, the function performs a second, more specific CIM query for each application using its Id and Revision as filters
  • This secondary query loads the lazy properties like AppDTs that are normally null/empty
  • Includes comprehensive error handling with warnings if lazy property loading fails for individual applications
  • Works with all connection types: CimSession, PSSession, and direct computer name
  • Feature is disabled by default to maintain current performance characteristics

Backward Compatibility

  • Maintains full backward compatibility - existing scripts continue to work unchanged
  • No performance impact when the switch is not used
  • All existing parameters and functionality remain intact

Performance Considerations

The feature significantly increases network activity as each application requires an additional CIM query. This is why it's disabled by default and should only be used when lazy properties are specifically needed.

Fixes #47.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Ability to load lazy properties Add lazy property loading support to Get-CCMApplication function Aug 28, 2025
@Copilot Copilot AI requested a review from CodyMathis123 August 28, 2025 13:57
Copilot finished work on behalf of CodyMathis123 August 28, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to load lazy properties
2 participants