mirror of
https://github.com/Micke-K/IntuneManagement.git
synced 2026-09-28 10:55:38 +02:00
3.10.1.18
Fixed issues: 402, 403 and 404 Added support for Install/Uninstall Script on Win32 apps Rebuilt Strings
This commit is contained in:
@@ -40,6 +40,7 @@ function Invoke-InitializeModule
|
||||
useDeviceContext="SettingDetails.installContextLabel"
|
||||
uninstallOnDeviceRemoval="SettingDetails.UninstallOnRemoval"
|
||||
isRemovable="SettingDetails.installAsRemovable"
|
||||
preventManagedAppBackup="AppResources.AppSettingsUx.preventManagedAppBackup"
|
||||
vpnConfigurationId="PolicyType.vpn"
|
||||
Action="SettingDetails.actionColumnName"
|
||||
Schedule="ScheduledAction.List.schedule"
|
||||
@@ -605,7 +606,7 @@ function Get-ObjectTypeString
|
||||
|
||||
function Add-BasicDefaultValues
|
||||
{
|
||||
param($obj, $objectType)
|
||||
param($obj, $objectType, $profileTypeName = $null)
|
||||
|
||||
Add-BasicPropertyValue (Get-LanguageString "SettingDetails.nameName") (Get-GraphObjectName $obj $objectType)
|
||||
Add-BasicPropertyValue (Get-LanguageString "SettingDetails.descriptionName") $obj.description
|
||||
@@ -616,7 +617,7 @@ function Add-BasicDefaultValues
|
||||
if($objInfo)
|
||||
{
|
||||
$platformType = Get-LanguageString "Platform.$($objInfo.PlatformLanguageId)"
|
||||
$profileType = Get-LanguageString "ConfigurationTypes.$($objInfo.PolicyType)"
|
||||
$profileType = (?? $profileTypeName (Get-LanguageString "ConfigurationTypes.$($objInfo.PolicyType)"))
|
||||
|
||||
if($platformType) { Add-BasicPropertyValue (Get-LanguageString "SettingDetails.platformSupported") $platformType }
|
||||
if($profileType) { Add-BasicPropertyValue (Get-LanguageString "TableHeaders.configurationType") $profileType }
|
||||
@@ -3780,6 +3781,7 @@ function Invoke-TranslateAssignments
|
||||
"uninstallOnDeviceRemoval",
|
||||
"isRemovable",
|
||||
"useDeviceLicensing",
|
||||
"preventManagedAppBackup",
|
||||
"androidManagedStoreAppTrackIds",
|
||||
"deliveryOptimizationPriority",
|
||||
"installTimeSettings",
|
||||
@@ -3880,7 +3882,7 @@ function Invoke-TranslateAssignments
|
||||
}
|
||||
$value = $tmpStr -f $tmpType
|
||||
}
|
||||
elseif($assignment.settings.$settingProp -eq "notConfigured")
|
||||
elseif("$($assignment.settings.$settingProp)" -eq "notConfigured")
|
||||
{
|
||||
$value = Get-LanguageString "BooleanActions.notConfigured"
|
||||
}
|
||||
|
||||
@@ -906,8 +906,29 @@ function Add-CDDocumentCustomProfileProperty
|
||||
|
||||
$retValue = $true
|
||||
}
|
||||
elseif($obj.'@OData.Type' -like "#microsoft.graph.iosDeviceFeaturesConfiguration")
|
||||
elseif($obj.'@OData.Type' -like "#microsoft.graph.iosDeviceFeaturesConfiguration")
|
||||
{
|
||||
foreach($configuration in $obj.iosSingleSignOnExtension.configurations)
|
||||
{
|
||||
$configurationType = "notConfigured"
|
||||
if($configuration."@OData.Type" -eq "#microsoft.graph.keyStringValuePair")
|
||||
{
|
||||
$configurationType = Get-LanguageString "SettingDetails.singleSignOnExtensionConfigurationsTypeColumnOptionString"
|
||||
}
|
||||
elseif($configuration."@OData.Type" -eq "#microsoft.graph.keyBooleanValuePair")
|
||||
{
|
||||
$configurationType = Get-LanguageString "SettingDetails.singleSignOnExtensionConfigurationsTypeColumnOptionBoolean"
|
||||
}
|
||||
elseif($configuration."@OData.Type" -eq "#microsoft.graph.keyIntegerValuePair")
|
||||
{
|
||||
$configurationType = Get-LanguageString "SettingDetails.singleSignOnExtensionConfigurationsTypeColumnOptionInteger"
|
||||
}
|
||||
|
||||
$configuration | Add-Member Noteproperty -Name "configurationKey" -Value $configuration.key -Force
|
||||
$configuration | Add-Member Noteproperty -Name "configurationValue" -Value $configuration.value -Force
|
||||
$configuration | Add-Member Noteproperty -Name "configurationType" -Value $configurationType -Force
|
||||
|
||||
}
|
||||
#singleSignOnSettings
|
||||
$obj | Add-Member Noteproperty -Name "kerberosPrincipalName" -Value (?? $obj.singleSignOnSettings.kerberosPrincipalName "notConfigured") -Force
|
||||
|
||||
@@ -1218,6 +1239,10 @@ function Add-CDDocumentCustomProfileProperty
|
||||
$returnCodes = @()
|
||||
$detectionRules = @()
|
||||
$requirementRules = @()
|
||||
$activeScripts = @()
|
||||
$activeInstallScript = $null
|
||||
$activeUninstallScript = $null
|
||||
|
||||
foreach($rc in $obj.returnCodes)
|
||||
{
|
||||
$returnCodes += [PSCustomObject]@{
|
||||
@@ -1246,6 +1271,46 @@ function Add-CDDocumentCustomProfileProperty
|
||||
}
|
||||
}
|
||||
|
||||
if($obj.activeInstallScript.'#ScriptInfo')
|
||||
{
|
||||
$scriptType = "install"
|
||||
$obj.installCommandLine = $null
|
||||
$installType = "Win32Program.installScript"
|
||||
|
||||
$activeInstallScript = [PSCustomObject]@{
|
||||
scriptType = $scriptType
|
||||
scriptName = $obj.activeInstallScript.'#ScriptInfo'.displayName
|
||||
scriptContent = $obj.activeInstallScript.'#ScriptInfo'.ScriptContent
|
||||
enforceSignatureCheck = $obj.activeInstallScript.'#ScriptInfo'.enforceSignatureCheck
|
||||
runAs32Bit = $obj.activeInstallScript.'#ScriptInfo'.runAs32Bit
|
||||
}
|
||||
Add-ObjectScript $header ("{0} - {1}" -f @($obj.displayName,$obj.activeInstallScript.'#ScriptInfo'.displayName)) $obj.activeInstallScript.'#ScriptInfo'.content
|
||||
}
|
||||
else
|
||||
{
|
||||
$installType = "Win32Program.installCommand"
|
||||
}
|
||||
|
||||
if($obj.activeUninstallScript.'#ScriptInfo')
|
||||
{
|
||||
$scriptType = "uninstall"
|
||||
$obj.uninstallCommandLine = $null
|
||||
$uninstallType = "Win32Program.uninstallScript"
|
||||
|
||||
$activeUninstallScript = [PSCustomObject]@{
|
||||
scriptType = $scriptType
|
||||
scriptName = $obj.activeUninstallScript.'#ScriptInfo'.displayName
|
||||
scriptContent = $obj.activeUninstallScript.'#ScriptInfo'.ScriptContent
|
||||
enforceSignatureCheck = $obj.activeUninstallScript.'#ScriptInfo'.enforceSignatureCheck
|
||||
runAs32Bit = $obj.activeUninstallScript.'#ScriptInfo'.runAs32Bit
|
||||
}
|
||||
Add-ObjectScript $header ("{0} - {1}" -f @($obj.displayName,$obj.activeUninstallScript.'#ScriptInfo'.displayName)) $obj.activeUninstallScript.'#ScriptInfo'.content
|
||||
}
|
||||
else
|
||||
{
|
||||
$uninstallType = "Win32Program.uninstallCommand"
|
||||
}
|
||||
|
||||
foreach($rule in $obj.requirementRules)
|
||||
{
|
||||
if($rule.'@OData.Type' -eq "#microsoft.graph.win32LobAppFileSystemRequirement")
|
||||
@@ -1305,7 +1370,7 @@ function Add-CDDocumentCustomProfileProperty
|
||||
$detectionRules += Add-CDDocumentDetectionRule $rule
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$obj | Add-Member Noteproperty -Name "requirementRulesSummary" -Value ($requirementRulesSummary -join $objSeparator) -Force
|
||||
$obj | Add-Member Noteproperty -Name "detectionRulesSummary" -Value ($detectionRulesSummary -join $objSeparator) -Force
|
||||
$obj | Add-Member Noteproperty -Name "dependencyApps" -Value ($dependencyApps -join $objSeparator) -Force
|
||||
@@ -1313,8 +1378,12 @@ function Add-CDDocumentCustomProfileProperty
|
||||
$obj | Add-Member Noteproperty -Name "detectionRulesType" -Value $detectionRulesType -Force
|
||||
$obj | Add-Member Noteproperty -Name "requirementRulesTranslated" -Value $requirementRules -Force
|
||||
$obj | Add-Member Noteproperty -Name "detectionRulesTranslated" -Value $detectionRules -Force
|
||||
$obj | Add-Member Noteproperty -Name "returnCodes" -Value $returnCodes -Force
|
||||
$obj | Add-Member Noteproperty -Name "returnCodes" -Value $returnCodes -Force
|
||||
$obj | Add-Member Noteproperty -Name "activeInstallScript" -Value $activeInstallScript -Force
|
||||
$obj | Add-Member Noteproperty -Name "activeUninstallScript" -Value $activeUninstallScript -Force
|
||||
$obj | Add-Member Noteproperty -Name "win10Release" -Value (Get-LanguageString "MinimumOperatingSystem.Windows.V10Release.release$($obj.minimumSupportedWindowsRelease)") -Force
|
||||
$obj | Add-Member Noteproperty -Name "installerType" -Value (Get-LanguageString $installType) -Force
|
||||
$obj | Add-Member Noteproperty -Name "uninstallerType" -Value (Get-LanguageString $uninstallType) -Force
|
||||
}
|
||||
elseif($obj.'@OData.Type' -eq "#microsoft.graph.deviceHealthScript")
|
||||
{
|
||||
@@ -1869,8 +1938,21 @@ function Invoke-CDDocumentAndroidManagedStoreAppConfiguration
|
||||
###################################################
|
||||
# Basic info
|
||||
###################################################
|
||||
$profileString = $null
|
||||
if($obj.profileApplicability -eq "default")
|
||||
{
|
||||
$profileString = Get-LanguageString "ProfileType.workProfileAndDeviceOwner"
|
||||
}
|
||||
elseif($obj.profileApplicability -eq "androidWorkProfile")
|
||||
{
|
||||
$profileString = Get-LanguageString "ProfileType.workProfileOnly"
|
||||
}
|
||||
elseif($obj.profileApplicability -eq "androidDeviceOwner")
|
||||
{
|
||||
$profileString = Get-LanguageString "ProfileType.deviceOwnerOnly"
|
||||
}
|
||||
|
||||
Add-BasicDefaultValues $obj $objectType
|
||||
Add-BasicDefaultValues $obj $objectType $profileString
|
||||
Add-BasicAdditionalValues $obj $objectType
|
||||
#Add-BasicPropertyValue (Get-LanguageString "TableHeaders.configurationType") (Get-LanguageString "SettingDetails.appConfiguration")
|
||||
#Add-BasicPropertyValue (Get-LanguageString "Inputs.enrollmentTypeLabel") (Get-LanguageString "EnrollmentType.devicesWithEnrollment")
|
||||
|
||||
@@ -2891,6 +2891,37 @@ function Start-PostGetApplications {
|
||||
$obj.Object | Add-Member -MemberType NoteProperty -Name "#CustomRefSupersedence" -Value ($supersededApps -join "|*|")
|
||||
}
|
||||
}
|
||||
|
||||
if($obj.Object.'@odata.type' -eq "#microsoft.graph.win32LobApp")
|
||||
{
|
||||
if($obj.Object.activeInstallScript.targetId -or $obj.Object.activeUninstallScript.targetId)
|
||||
{
|
||||
$scriptInfo = (Invoke-GraphRequest -Url "/deviceAppManagement/mobileApps/$($obj.Id)/microsoft.graph.win32LobApp/contentVersions/$($obj.Object.committedContentVersion)/scripts/").value
|
||||
|
||||
foreach($script in $scriptInfo) {
|
||||
$scriptFullInfo = (Invoke-GraphRequest -Url "/deviceAppManagement/mobileApps/$($obj.Id)/microsoft.graph.win32LobApp/contentVersions/$($obj.Object.committedContentVersion)/scripts/$($script.id)?`$select=Id,Content")
|
||||
if($scriptFullInfo.Content)
|
||||
{
|
||||
$script.content = $scriptFullInfo.Content
|
||||
}
|
||||
|
||||
if($obj.Object.activeInstallScript.targetId -eq $script.id)
|
||||
{
|
||||
$tpObject = $obj.Object.activeInstallScript
|
||||
}
|
||||
elseif($obj.Object.activeUninstallScript.targetId -eq $script.id)
|
||||
{
|
||||
$tpObject = $obj.Object.activeUninstallScript
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Log "Script with id $($script.id) is not referenced by active install or uninstall script. Skipping." 2
|
||||
continue
|
||||
}
|
||||
$tpObject | Add-Member -MemberType NoteProperty -Name "#ScriptInfo" -Value $script -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Start-PostImportApplications
|
||||
|
||||
Reference in New Issue
Block a user