aaronparker / vcredist

Lifecycle management for the Microsoft Visual C++ Redistributables
https://vcredist.com
MIT License
132 stars 17 forks source link

Import-VcConfigMgrApplication #96

Closed othyssen closed 1 year ago

othyssen commented 2 years ago

Expected Behavior

When running Import-VcConfigMgrApplication and the application already exists it should skip and try next VcRedist

Current Behavior

Import-VcConfigMgrApplication drops an error and stops

Failure Information (for bugs)

Paste the verbose output from the command here

An object with the specified name already exists.
At C:\Program Files\WindowsPowerShell\Modules\VcRedist\3.0.320\Public\Import-VcConfigMgrApplication.ps1:191 char:33
+                                 Throw $_.Exception.Message
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (An object with ...already exists.:String) [], RuntimeException
    + FullyQualifiedErrorId : An object with the specified name already exists.

If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Have no VcRedist in MECM, run Get-VcList/Save-VcRedist/Import-VcConfigMgrApplication, everything fine, all will be created
  2. Run the same again as some updated VcRedists have been released, it fail on those who haven't updated

The existing applications cannot be deleted beforehand as they are used in Task-Sequences

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

An "Update-VcConfigMgrApplication" would be fine, similar to the MDT's Update-VcMdtApplication

aaronparker commented 1 year ago

Fixed in 4.1.493