Set-CMMSIDeploymentType

Iron Contributor

Hi,

   I'm working on a powershell script to process old applications to a retired state.  As part of that, i move the files out of our production area to an "old" area. that works fine, however when I attempt to set the deployment types new content path with a command like the one below, if fails.  Why is it talking about a wrong file extension? my command doesn't reference anything regarding files.  

App deployment type is MSI technology ( as indicated by the name)

The installation program is a standard msi install with a log switch. 

 

I have copied the cmd line out and added all entries directly rather than via variables and run from an elevated PS ISE while connected to the site and still see the same message.  

 

I see nothing of use on the doco page - Set-CMMsiDeploymentType (ConfigurationManager) - Configuration Manager | Microsoft Docs

 

This is the command I'm running.  

Set-CMMSIDeploymentType –ApplicationName 'ECM Classic ODBC - PROD' –DeploymentTypeName 'ECM Classic ODBC - Prod - Windows Installer (*.msi file)' –ContentLocation '\\corp\cm\LIBRARY\OLD_SupercededSoftware\1_RetiredApplications\2019\ECM\Classic-ODBC\2019.05\PRD\' -Force

 

**********************************************************

returns this error

 

Set-CMMSIDeploymentType : Unexpected file extension specified. Must be one of: .msi
At line:1 char:5
+ Set-CMMSIDeploymentType –ApplicationName 'ECM Classic ODBC - PROD ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...mentTypeCommand:SetMsiDeploymentTypeCommand) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ContentValidationError,Microsoft.ConfigurationManagement.Cmdlets.AppMan.Commands.SetMsiDeploymentTypeCommand

Set-CMMSIDeploymentType : Validation of input parameters failed. Cannot continue.
At line:1 char:5
+ Set-CMMSIDeploymentType –ApplicationName 'ECM Classic ODBC - PROD ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...mentTypeCommand:SetMsiDeploymentTypeCommand) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ValidationFailed,Microsoft.ConfigurationManagement.Cmdlets.AppMan.Commands.SetMsiDeploymentTypeCommand

8 Replies

Also add that running basically the same command on a "Script Technology" Deployment type with the Set-CMScriptDeploymentType command works perfectly.  

 

the two commands in use

First one fails when run for an MSI DT, second one works when run against a Script DT - 

Set-CMMSIDeploymentType –ApplicationName "$app" –DeploymentTypeName "$DeploymentTypeName" –ContentLocation "$RetiredContentDir"
Set-CMScriptDeploymentType –ApplicationName "$app" –DeploymentTypeName "$DeploymentTypeName" –ContentLocation "$RetiredContentDir"

I tried outputting the error and got this

 

- Validation of input parameters failed. Cannot continue. Unexpected file extension specified. Must be one of: .msi No content destination was found. This can happen when an invalid collection, distribution point, or distribution point is specified or if the content has already been distributed to the specified destination. 

 

with the bit from "No content destination..." repeated about 100 times.  

 

Setting the content path to where the files was never essential, just a nice to have as obviously the apps are retired and shouldn't be required anymore.  I would prefer to have it working though.  

I have done some more testing and if I identify an MSI that is in the content folder, append that to the content location, the command works...HOWEVER, it also wipes the custom command line for installation I had and replaces it with a generic msiexec command.  

so then this is the content location switch

-ContentLocation '\\myserver\Mypath\myApp\v1.0\ICServerManagerApps2.msi'

and I get an installation program of "msiexec /i "myAppv1.0.msi" /q" which has replaced the cmd line I already had with log file and msp switches.  

 

All I want to do is change the content location, I don't want the installation cmd changed.  

 

Note that as I said above the "Set-CMScript..." works with just a path, I just tested the Set-CMWindowsAppxDeploymentType command and that also works with just the content location path.  

I don't understand why the MSI one is different and why I can't just update the content path without wiping my installation cmd and replacing with a default one.  

I'll see if there is an official answer, submitted feedback as per below. 

 

Powershell - Set-CMMSIDeploymentType

maybe I'm doing something wrong here, but I think this command is defective.

set-CMMsiDeploymentType contentPath returns an error when run and it appears to be wanting the name of an MSI file as part of the path, however the content path is a directory, not a file.

for example, running this command returns the error

set-CMMsiDeploymentType -ApplicationName 'MyApp' -DeploymentTypeName 'MyDType - Windows Installer (*.msi file)' -ContentLocation '\\myserver\myapp\V1'

I am trying to change "Content Location" on the second tab in the deployment type - this is a directory, not a file.

the error is
set-CMMsiDeploymentType : Unexpected file extension specified. Must be one of: .msi
At line:1 char:1
+ set-CMMsiDeploymentType -ApplicationName 'Cisco Webex Meetings' -Depl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...mentTypeCommand:SetMsiDeploymentTypeCommand) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ContentValidationError,Microsoft.ConfigurationManagement.Cmdlets.AppMan.Commands.SetMsiDeploymentTypeCommand

set-CMMsiDeploymentType : Validation of input parameters failed. Cannot continue.
At line:1 char:1
+ set-CMMsiDeploymentType -ApplicationName 'Cisco Webex Meetings' -Depl ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...mentTypeCommand:SetMsiDeploymentTypeCommand) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ValidationFailed,Microsoft.ConfigurationManagement.Cmdlets.AppMan.Commands.SetMsiDeploymentTypeCommand
***********************************
this doesn't make sense to me, why do i need to somehow figure out what the name of one of the MSI's in the content location is to add to my script when the file isn't used in the content location. I definitely don't want the MSI shown in the content path as obviously that won't work.

Am I missing something?

I have tested this with both Set-CMScriptDeploymentType and Set-CMWindowsAppxDeploymentType - both these work as expected for those types of Deployment Type with just the content location ( no file names required. )

If I browse to the content location for the MSI, locate an MSI in there and append that to the content location, this then updates the content location, HOWEVER, it also wipes the current installation command and replaces it with a generic msi installation commandline for the MSI i put in the config script.

that is, rather than this command
set-CMMsiDeploymentType -ApplicationName 'MyApp' -DeploymentTypeName 'MyDType - Windows Installer (*.msi file)' -ContentLocation '\\myserver\myapp\V1'

I use this (which updates the content path, but also wipes my installation command. )
set-CMMsiDeploymentType -ApplicationName 'MyApp' -DeploymentTypeName 'MyDType - Windows Installer (*.msi file)' -ContentLocation '\\myserver\myapp\V1\myMSIv1.msi'

I thought this might be fixed as per the doco,
https://docs.microsoft.com/en-us/powershell/module/configurationmanager/set-cmmsideploymenttype?view...
***************
-ContentLocation
Specifies the network source path of the MSI file. The site system server requires permission to read the content files.
Starting in version 2107, you can specify the path of the MSI file or the path to the folder that contains the MSI.
************************
I'm on 2107 but it still errors

PS TSV:\> (get-module -name ConfigurationManager).version

Major Minor Build Revision
----- ----- ----- --------
5 2107 1059 3700

 

this is the sort of command I am running
Set-CMMSIDeploymentType –ApplicationName "My App V5.19.0" –DeploymentTypeName "My App V5.19.0 - Windows Installer (*.msi file)" –ContentLocation "\\MyServer\MyPath\My App\5.19.0"

 

which returns the following ( apart from the fact I changed the name of the app to post here. )

 

Set-CMMSIDeploymentType : Unexpected file extension specified. Must be one of: .msi
At line:1 char:1
+ Set-CMMSIDeploymentType –ApplicationName "My App V5.19.0" –Dep ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...iDeploymentType:SetMsiDeploymentType) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ContentValidationError,Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType

Set-CMMSIDeploymentType : Validation of input parameters failed. Cannot continue.
At line:1 char:1
+ Set-CMMSIDeploymentType –ApplicationName "My App V5.19.0" –Dep ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...iDeploymentType:SetMsiDeploymentType) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ValidationFailed,Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...iDeploymentType:SetMsiDeploymentType) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ValidationFailed,Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType


doesn't look like anything has changed to me.

can you send the output of the following:
$error[0] | fl* -force

@Animesh Joshi , thanks for the response, output is below.  

Set-CMMSIDeploymentType : Unexpected file extension specified. Must be one of: .msi
At line:1 char:1
+ Set-CMMSIDeploymentType –ApplicationName "Spydus Tray 1.0.6" –Deploym ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...iDeploymentType:SetMsiDeploymentType) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ContentValidationError,Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType

Set-CMMSIDeploymentType : Validation of input parameters failed. Cannot continue.
At line:1 char:1
+ Set-CMMSIDeploymentType –ApplicationName "Spydus Tray 1.0.6" –Deploym ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Confi...iDeploymentType:SetMsiDeploymentType) [Set-CMMsiDeploymentType], InvalidOperationException
+ FullyQualifiedErrorId : ValidationFailed,Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType


PSMessageDetails :
Exception : System.InvalidOperationException: Validation of input parameters failed. Cannot continue.
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
TargetObject : Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType
CategoryInfo : InvalidArgument: (Microsoft.Confi...iDeploymentType:SetMsiDeploymentType) [Set-CMMsiDeploymentType], InvalidOperationException
FullyQualifiedErrorId : ValidationFailed,Microsoft.ConfigurationManagement.PowerShell.Cmdlets.AppMan.SetMsiDeploymentType
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}

@Animesh Joshi . thankyou for your response,
I have had feedback from Microsoft and they have clarified that I was missing an essential component to my command. The content path must end in a backslash. I have tried this and confirmed it works. So simple when you know the solution :) very happy camper. I still have around 60 DT's to go back and fix manually, but all my future ones should have the correct content path. Happy Days.