Microsoft

System Center Configuration Manager Feedback

Suggestion box powered by UserVoice

How can we improve Configuration Manager?

Include verbose information with import-cmpackage cmdlet

The Import-CMPackage cmdlet does not provide much in the way of verbose output with the -verbose flag. This would be useful to identify what the cmdlet is performing in the background to determine if package already exists with the same name or not.

Steps attempted:
$Global:VerbosePreference = "Continue"
$Global:DebugPreference = "Continue"
$Global:CMPSDebugLogging = $true

import-cmpackage -ImportFilePath "\\localhost\c$\Users\Testing\TestPkg.zip" -Verbose

Output: Verbose: Performing the operation "Import" on target "Package: ".

Trace-Command -Name metadata,parameterbinding,cmdlet -Expression {Import-CMPackage -ImportFilePath "\\localhost\c$\Users\Testing\TestPkg.zip" -WhatIf} -PSHost
DEBUG: ParameterBinding Information: 0 : BIND NAMED cmd line args [Import-CMPackage]
DEBUG: ParameterBinding Information: 0 : BIND arg [\\localhost\c$\Users\Testing\TestPkg.zip] to parameter [ImportFilePath]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.String]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : Executing VALIDATION metadata: [System.Management.Automation.ValidateNotNullOrEmptyAttribute]
DEBUG: ParameterBinding Information: 0 : BIND arg [\\localhost\c$\Users\Testing\TestPkg.zip] to param [ImportFilePath] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND arg [True] to parameter [WhatIf]
DEBUG: ParameterBinding Information: 0 : COERCE arg to [System.Management.Automation.SwitchParameter]
DEBUG: ParameterBinding Information: 0 : Parameter and arg types the same, no coercion is needed.
DEBUG: ParameterBinding Information: 0 : BIND arg [True] to param [WhatIf] SUCCESSFUL
DEBUG: ParameterBinding Information: 0 : BIND POSITIONAL cmd line args [Import-CMPackage]
DEBUG: ParameterBinding Information: 0 : MANDATORY PARAMETER CHECK on cmdlet [Import-CMPackage]
DEBUG: ParameterBinding Information: 0 : CALLING BeginProcessing
DEBUG: Begin execution of cmdlet: Import-CMPackage
DEBUG: Acquiring ConnectionManager
DEBUG: Using property 'SiteCode' for site code discovery if applicable.
What if: Performing the operation "Import" on target "Package: ".
DEBUG: ParameterBinding Information: 0 : CALLING EndProcessing
DEBUG: End execution of cmdlet: Import-CMPackage Execution time: 00:00:00.0020000

4 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Scott Kissel shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    Noted  · 

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Scott Kissel commented  ·   ·  Flag as inappropriate

        Please also ensure that the package version is also taken into account when determining whether a package already exists in the environment or not.

      Feedback and Knowledge Base