Skip to content

Instantly share code, notes, and snippets.

@CodyMathis123
Last active May 6, 2019 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodyMathis123/10c6cba7c48f4171bb1a59b6fcbae92f to your computer and use it in GitHub Desktop.
Save CodyMathis123/10c6cba7c48f4171bb1a59b6fcbae92f to your computer and use it in GitHub Desktop.
#region generate PSCustomObject that we will loop through to create DeploymentTypes
$DeploymentTypes = foreach ($XML in $FilteredXML_Configs) {
#region Load XML and manipulate based on input parameters, and gather information
$Config = $XML.Name
$ConfigXML = [xml]::new()
$ConfigXML.PreserveWhitespace = $true
$ConfigXML.Load($XML.FullName)
$ConfigXML.Configuration.AppSettings.Setup.Value = $Company
$ConfigXML.Configuration.Add.OfficeClientEdition = $XML_Bitness
$ConfigXML.Configuration.Add.Version = $FullBuildNumber
$ConfigXML.Configuration.Add.Channel = $XML_Channel
$ConfigXml.Configuration.Add.AllowCdnFallback = $($AllowCdnFallback | Out-String)
$ConfigXml.Configuration.Display.Level = $DisplayLevel
$ConfigXML.Save($XML.FullName)
$AppName = $ConfigXML.Configuration.Info.Description
$ProductIDs = $ConfigXML.Configuration.Add.Product.ID
#endregion Load XML and manipulate based on input parameters, and gather information
[PSCustomObject]@{
Config = $Config
AppName = $AppName
AppSource = $AppRoot
ProductIDs = $ProductIDs
NameLength = $($AppName.Length)
}
}
# We sort the deployment types so that the priority order ensures proper installation depending on existing apps
$DeploymentTypes = $DeploymentTypes | Sort-Object -Property NameLength, AppName -Descending
#endregion generate PSCustomObject that we will loop through to create DeploymentTypes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment