This commit is contained in:
Mikael Karlsson
2024-04-22 21:48:16 +10:00
parent 47968b4219
commit c16f85a299
57 changed files with 3788 additions and 2529 deletions

View File

@@ -160,8 +160,8 @@ function Invoke-ViewActivated
function Show-CompareBulkForm
{
$script:form = Get-XamlObject ($global:AppRootFolder + "\Xaml\BulkCompare.xaml") -AddVariables
if(-not $script:form) { return }
$script:cmpForm = Get-XamlObject ($global:AppRootFolder + "\Xaml\BulkCompare.xaml") -AddVariables
if(-not $script:cmpForm) { return }
$global:cbCompareProvider.ItemsSource = @(($global:compareProviders | Where BulkCompare -ne $null))
$global:cbCompareProvider.SelectedValue = (Get-Setting "Compare" "Provider" "export")
@@ -210,12 +210,12 @@ function Show-CompareBulkForm
$global:dgObjectsToCompare.ItemsSource = $script:compareObjects
Add-XamlEvent $script:form "btnClose" "add_click" {
$script:form = $null
Add-XamlEvent $script:cmpForm "btnClose" "add_click" {
$script:cmpForm = $null
Show-ModalObject
}
Add-XamlEvent $script:form "btnStartCompare" "add_click" {
Add-XamlEvent $script:cmpForm "btnStartCompare" "add_click" {
Write-Status "Compare objects"
Save-Setting "Compare" "Provider" $global:cbCompareProvider.SelectedValue
Save-Setting "Compare" "Type" $global:cbCompareType.SelectedValue
@@ -233,7 +233,7 @@ function Show-CompareBulkForm
Set-CompareProviderOptions $global:cbCompareProvider
Show-ModalForm "Bulk Compare Objects" $script:form -HideButtons
Show-ModalForm "Bulk Compare Objects" $script:cmpForm -HideButtons
}
function Set-CompareProviderOptions
@@ -1114,12 +1114,12 @@ function Set-ColumnVisibility
function Add-CompareProperty
{
param($name, $value1, $value2, $category, $subCategory, $match = $null)
param($name, $value1, $value2, $category, $subCategory, $match = $null, [switch]$skip)
$value1 = if($value1 -eq $null) { "" } else { $value1.ToString().Trim("`"") }
$value2 = if($value2 -eq $null) { "" } else { $value2.ToString().Trim("`"") }
$script:compareProperties += [PSCustomObject]@{
$compare += [PSCustomObject]@{
PropertyName = $name
Object1Value = $value1 #if($value1 -ne $null) { $value1.ToString().Trim("`"") } else { "" }
Object2Value = $value2 #if($value2 -ne $null) { $value2.ToString().Trim("`"") } else { "" }
@@ -1127,6 +1127,11 @@ function Add-CompareProperty
SubCategory = $subCategory
Match = ?? $match ($value1 -eq $value2)
}
if($skip -eq $true) {
$compare.Match = $null
}
$script:compareProperties += $compare
}
function Compare-ObjectsBasedonProperty
@@ -1137,8 +1142,11 @@ function Compare-ObjectsBasedonProperty
Set-ColumnVisibility $false
$skipBasicProperties = Get-XamlProperty $script:cmpForm "chkSkipCompareBasicProperties" "IsChecked"
$coreProps = @((?? $objectType.NameProperty "displayName"), "Description", "Id", "createdDateTime", "lastModifiedDateTime", "version")
$postProps = @("Advertisements")
$skipProps = @("@ObjectFromFile")
foreach ($propName in $coreProps)
{
@@ -1148,7 +1156,7 @@ function Compare-ObjectsBasedonProperty
}
$val1 = ($obj1.$propName | ConvertTo-Json -Depth 10)
$val2 = ($obj2.$propName | ConvertTo-Json -Depth 10)
Add-CompareProperty $propName $val1 $val2
Add-CompareProperty $propName $val1 $val2 -Skip:($skipBasicProperties -eq $true)
}
$addedProps = @()
@@ -1156,19 +1164,21 @@ function Compare-ObjectsBasedonProperty
{
if($propName -in $coreProps) { continue }
if($propName -in $postProps) { continue }
if($propName -in $skipProps) { continue }
if($propName -like "*@OData*" -or $propName -like "#microsoft.graph*") { continue }
$addedProps += $propName
$val1 = ($obj1.$propName | ConvertTo-Json -Depth 10)
$val2 = ($obj2.$propName | ConvertTo-Json -Depth 10)
Add-CompareProperty $propName $val1 $val2
Add-CompareProperty $propName $val1 $val2 -Skip:($skipBasicProperties -eq $true)
}
foreach ($propName in ($obj2.PSObject.Properties | Select Name).Name)
{
if($propName -in $coreProps) { continue }
if($propName -in $postProps) { continue }
if($propName -in $skipProps) { continue }
if($propName -in $addedProps) { continue }
if($propName -like "*@OData*" -or $propName -like "#microsoft.graph*") { continue }
@@ -1178,6 +1188,7 @@ function Compare-ObjectsBasedonProperty
Add-CompareProperty $propName $val1 $val2
}
$skipAssignments = Get-XamlProperty $script:cmpForm "chkSkipCompareAssignments" "IsChecked"
foreach ($propName in $postProps)
{
if(-not ($obj1.PSObject.Properties | Where Name -eq $propName))
@@ -1186,7 +1197,7 @@ function Compare-ObjectsBasedonProperty
}
$val1 = ($obj1.$propName | ConvertTo-Json -Depth 10)
$val2 = ($obj2.$propName | ConvertTo-Json -Depth 10)
Add-CompareProperty $propName $val1 $val2
Add-CompareProperty $propName $val1 $val2 -Skip:($skipAssignments -eq $true)
}
$script:compareProperties
@@ -1230,10 +1241,12 @@ function Compare-ObjectsBasedonDocumentation
$settingsValue = ?? $objectType.CompareValue "Value"
$skipBasicProperties = Get-XamlProperty $script:cmpForm "chkSkipCompareBasicProperties" "IsChecked"
if($docObj1.BasicInfo -and -not ($docObj1.BasicInfo | where Value -eq $obj1.Id))
{
# Make sure the Id property is included
Add-CompareProperty "Id" $obj1.Id $obj2.Id $docObj1.BasicInfo[0].Category
Add-CompareProperty "Id" $obj1.Id $obj2.Id $docObj1.BasicInfo[0].Category -Skip:($skipBasicProperties -eq $true)
}
foreach ($prop in $docObj1.BasicInfo)
@@ -1241,7 +1254,7 @@ function Compare-ObjectsBasedonDocumentation
$val1 = $prop.Value
$prop2 = $docObj2.BasicInfo | Where Name -eq $prop.Name
$val2 = $prop2.Value
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category -Skip:($skipBasicProperties -eq $true)
}
$addedProperties = @()
@@ -1250,11 +1263,16 @@ function Compare-ObjectsBasedonDocumentation
{
foreach ($prop in $docObj1.Settings)
{
if(($prop.SettingId + $prop.ParentSettingId) -in $addedProperties) { continue }
if(($prop.SettingId + $prop.ParentSettingId + $prop.RowIndex) -in $addedProperties) { continue }
$addedProperties += ($prop.SettingId + $prop.ParentSettingId)
$addedProperties += ($prop.SettingId + $prop.ParentSettingId + $prop.RowIndex)
$val1 = $prop.Value
$prop2 = $docObj2.Settings | Where { $_.SettingId -eq $prop.SettingId -and $_.ParentSettingId -eq $prop.ParentSettingId }
$prop2 = $docObj2.Settings | Where { $_.SettingId -eq $prop.SettingId -and $_.ParentSettingId -eq $prop.ParentSettingId -and $_.RowIndex -eq $prop.RowIndex }
if($val1 -isnot [Array] -and $prop2.Value -is [Array])
{
Write-Log "Compare property for $($prop.SettingId) found based on value" 2
$prop2 = $prop2 | Where Value -eq $val1
}
$val2 = $prop2.Value
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category
@@ -1265,12 +1283,18 @@ function Compare-ObjectsBasedonDocumentation
# Add children defined on Object 1 property
foreach ($childProp in $children1)
{
if(($childProp.SettingId + $childProp.ParentSettingId) -in $addedProperties) { continue }
if(($childProp.SettingId + $childProp.ParentSettingId + $childProp.RowIndex) -in $addedProperties) { continue }
$addedProperties += ($childProp.SettingId + $childProp.ParentSettingId)
$addedProperties += ($childProp.SettingId + $childProp.ParentSettingId + $childProp.RowIndex)
$val1 = $childProp.Value
$prop2 = $docObj2.Settings | Where { $_.SettingId -eq $childProp.SettingId -and $_.ParentSettingId -eq $childProp.ParentSettingId }
$prop2 = $docObj2.Settings | Where { $_.SettingId -eq $childProp.SettingId -and $_.ParentSettingId -eq $childProp.ParentSettingId -and $_.RowIndex -eq $childProp.RowIndex}
if($val1 -isnot [Array] -and $prop2.Value -is [Array])
{
Write-Log "Compare property for $($childProp.SettingId) found based on value" 2
$prop2 = $prop2 | Where Value -eq $val1
}
$val2 = $prop2.Value
Add-CompareProperty $childProp.Name $val1 $val2 $prop.Category
}
@@ -1278,11 +1302,16 @@ function Compare-ObjectsBasedonDocumentation
# This is to make sure all children are added under its parent and not last in the table
foreach ($childProp in $children2)
{
if(($childProp.SettingId + $childProp.ParentSettingId) -in $addedProperties) { continue }
if(($childProp.SettingId + $childProp.ParentSettingId + $childProp.RowIndex) -in $addedProperties) { continue }
$addedProperties += ($childProp.SettingId + $childProp.ParentSettingId)
$addedProperties += ($childProp.SettingId + $childProp.ParentSettingId + $childProp.RowIndex)
$val2 = $childProp.Value
$prop2 = $docObj1.Settings | Where { $_.SettingId -eq $childProp.SettingId -and $_.ParentSettingId -eq $childProp.ParentSettingId }
$prop2 = $docObj1.Settings | Where { $_.SettingId -eq $childProp.SettingId -and $_.ParentSettingId -eq $childProp.ParentSettingId -and $_.RowIndex -eq $childProp.RowIndex }
if($val2 -isnot [Array] -and $prop2.Value -is [Array])
{
Write-Log "Compare property for $($childProp.SettingId) found based on value" 2
$prop2 = $prop2 | Where Value -eq $val1
}
$val1 = $prop2.Value
Add-CompareProperty $childProp.Name $val1 $val2 $prop.Category
}
@@ -1291,12 +1320,17 @@ function Compare-ObjectsBasedonDocumentation
# These objects are defined only on Object 2. They will be last in the table
foreach ($prop in $docObj2.Settings)
{
if(($prop.SettingId + $prop.ParentSettingId) -in $addedProperties) { continue }
if(($prop.SettingId + $prop.ParentSettingId + $prop.RowIndex) -in $addedProperties) { continue }
$addedProperties += ($prop.SettingId + $prop.ParentSettingId)
$addedProperties += ($prop.SettingId + $prop.ParentSettingId + $prop.RowIndex)
$val2 = $prop.Value
$prop2 = $docObj1.Settings | Where { $_.SettingId -eq $prop.SettingId -and $_.ParentSettingId -eq $prop.ParentSettingId }
$val1 = $prop2.Value
$prop2 = $docObj1.Settings | Where { $_.SettingId -eq $prop.SettingId -and $_.ParentSettingId -eq $prop.ParentSettingId -and $_.RowIndex -eq $childProp.RowIndex }
if($val2 -isnot [Array] -and $prop2.Value -is [Array])
{
Write-Log "Compare property for $($prop.SettingId) found based on value" 2
$prop2 = $prop2 | Where Value -eq $val2
}
$val1 = $prop2.Value
Add-CompareProperty $prop.Name $val1 $val2 $prop.Category
}
}
@@ -1464,12 +1498,14 @@ function Add-AssignmentInfo
$val2 = $tmpVal
}
$skipAssignments = Get-XamlProperty $script:cmpForm "chkSkipCompareAssignments" "IsChecked"
if($assignment.RawIntent)
{
Add-CompareProperty $assignment.Category $val1 $val2 -Category $assignment.GroupMode -match $match
Add-CompareProperty $assignment.Category $val1 $val2 -Category $assignment.GroupMode -match $match -Skip:($skipAssignments -eq $true)
}
else
{
Add-CompareProperty $assignmentStr $val1 $val2 -Category $assignment.GroupMode -match $match
Add-CompareProperty $assignmentStr $val1 $val2 -Category $assignment.GroupMode -match $match -Skip:($skipAssignments -eq $true)
}
}

View File

@@ -20,7 +20,7 @@ $global:documentationProviders = @()
function Get-ModuleVersion
{
'2.1.0'
'2.2.0'
}
function Invoke-InitializeModule
@@ -1066,16 +1066,29 @@ function Invoke-TranslateSettingsObject
$global:cfgCategories = (Invoke-GraphRequest "/deviceManagement/configurationCategories?`$filter=platforms has 'windows10' and technologies has 'mdm'" -ODataMetadata "minimal" @params).Value
}
if(-not $global:cachedCfgSettings)
{
$global:cachedCfgSettings = @{}
}
$script:settingCatalogasCategories = @{}
foreach($cfgSetting in $cfgSettings)
{
if($obj.'@ObjectFromFile' -and -not $cfgSetting.settingDefinitions)
{
$defObj = Invoke-GraphRequest "/deviceManagement/configurationSettings/$($cfgSetting.settingInstance.settingDefinitionId)"
if($global:cachedCfgSettings.ContainsKey($cfgSetting.settingInstance.settingDefinitionId) -eq $false)
{
$defObj = Invoke-GraphRequest "/deviceManagement/configurationSettings/$($cfgSetting.settingInstance.settingDefinitionId)"
$global:cachedCfgSettings.Add($defObj.Id, $defObj)
}
}
else
{
$defObj = $cfgSetting.settingDefinitions | Where id -eq $cfgSetting.settingInstance.settingDefinitionId
if($global:cachedCfgSettings.ContainsKey($cfgSetting.settingInstance.settingDefinitionId) -eq $false)
{
$global:cachedCfgSettings.Add($defObj.Id, $defObj)
}
}
#$defObj = $cfgSetting.settingDefinitions | Where { $_.id -eq $cfgSetting.settingInstance.settingDefinitionId -or $_.id -eq $cfgSettings.settingInstanceTemplate.settingDefinitionId }
if(-not $defObj -or $script:settingCatalogasCategories.ContainsKey($defObj.categoryId)) { continue }
@@ -1089,13 +1102,13 @@ function Invoke-TranslateSettingsObject
Category=$catObj
#Settings=$catSettings
RootCategory=$rootCatObj
}))
}))
}
$script:curSettingsCatologPolicy = @()
$cfgSettings | % { Add-SettingsSetting $_.settingInstance $_.settingDefinitions } | Out-Null
#$script:objectSettingsData = $script:curSettingsCatologPolicy
foreach($item in ($script:curSettingsCatologPolicy | Select @{l="CategoryID";e={$_.CategoryDefinition.Id}}, @{l="SubCategoryID";e={$_.SubCategoryDefinition.Id}} -Unique))
@@ -1125,7 +1138,15 @@ function Add-SettingsSetting
$settingsDef = $settingsDefs | Where id -eq $settingInstance.settingDefinitionId
if(-not $settingsDef -and $settingInstance.settingDefinitionId)
{
$settingsDef = Invoke-GraphRequest "/deviceManagement/configurationSettings/$($settingInstance.settingDefinitionId)"
if($global:cachedCfgSettings.ContainsKey($settingInstance.settingDefinitionId) -eq $false)
{
$settingsDef = Invoke-GraphRequest "/deviceManagement/configurationSettings/$($settingInstance.settingDefinitionId)"
$global:cachedCfgSettings.Add($settingInstance.settingDefinitionId, $settingsDef)
}
else
{
$settingsDef = $global:cachedCfgSettings[$settingInstance.settingDefinitionId]
}
}
$categoryDef = $global:cfgCategories | Where Id -eq $settingsDef.categoryId #$script:settingCatalogasCategories[$settingsDef.categoryId]
@@ -1143,6 +1164,7 @@ function Add-SettingsSetting
$settingInfo = [PSCustomObject]@{
SettingId = $settingsDef.Id
SettingKey = ""
SettingName = $settingsDef.Name
Name = $settingsDef.displayName
Description=$settingsDef.description
@@ -1161,6 +1183,7 @@ function Add-SettingsSetting
Show = $show
Type = $settingInstance.'@odata.type'
PropertyIndex = 0
RowIndex = 0
ChildSettings = @() #($childSettings | Sort DisplayName)
}
@@ -1226,13 +1249,13 @@ function Add-SettingsSetting
{
$childSettingsArr = @()
# Not sure if this is the best way but it looks better for tested policies
if($script:currentObject.templateReference.templateId)
if($script:currentObject.templateReference.templateId -and $settingsDefs)
{
$childIDs = $settingsDefs.id # Endpoint Security objects
}
else
{
$childIDs = $settingsDef.childIds # Setings Catalog
$childIDs = $settingsDef.childIds # Setings Catalog and from file documentation
}
#foreach($childId in $settingsDefs.id) #$settingsDef.childIds)
foreach($childId in $childIDs)
@@ -1243,6 +1266,7 @@ function Add-SettingsSetting
if($tmpSetting)
{
$tmpSetting.Parent = $childSettings
$tmpSetting.RowIndex = $index
$childSettings += $tmpSetting
$childSettingsArr += $tmpSetting
if($settingsDef.childIds.Count -gt 1)
@@ -1250,6 +1274,7 @@ function Add-SettingsSetting
$tmpSetting.PropertyIndex = $childSettingsArr.Count
}
}
$rowIndex++
}
$settingInfo.ChildSettings += [PSCustomObject]@{
@@ -1365,6 +1390,7 @@ function Get-IntentCategory
return (Get-LanguageString "SecurityTemplate.firewall")
}
elseif($templateType -eq "securityBaseline" -or
$templateType -eq "baseline" -or
$templateType -eq "advancedThreatProtectionSecurityBaseline" -or
$templateType -eq "microsoftEdgeSecurityBaseline")
{

View File

@@ -10,7 +10,7 @@ This module is for the Endpoint Manager/Intune View. It manages Export/Import/Co
#>
function Get-ModuleVersion
{
'3.9.5'
'3.9.6'
}
function Invoke-InitializeModule
@@ -89,6 +89,22 @@ function Invoke-InitializeModule
SubPath = "EndpointManager"
}) "EndpointManager"
Get-SettingValue "ProxyURI"
if($global:FirstTimeRunning) {
Save-Setting "EndpointManager" "EMAzureApp" $global:DefaultAzureApp
}
$currentAppID = Get-SettingValue "EMAzureApp"
$customAppID = Get-SettingValue "EMCustomAppId"
$global:informOldAzureApp = $false
if(($global:OldAzureApps -is [Array] -and $currentAppID -in $global:OldAzureApps) -or (-not $currentAppID -and -not $customAppID))
{
$global:informOldAzureApp = $true
Write-Log "Microsoft Intune PowerShell is being decomissioned. Please change to a supported app eg Microsoft Graph or a custom app!" 2
}
$viewPanel = Get-XamlObject ($global:AppRootFolder + "\Xaml\EndpointManagerPanel.xaml") -AddVariables
Set-EMViewPanel $viewPanel
@@ -105,7 +121,7 @@ function Invoke-InitializeModule
Activating = { Invoke-EMActivatingView }
Authentication = (Get-MSALAuthenticationObject)
Authenticate = { Invoke-EMAuthenticateToMSAL @args }
AppInfo = (Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" "EM")
AppInfo = (Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp "EM")
SaveSettings = { Invoke-EMSaveSettings }
Permissions = @()
@@ -802,7 +818,7 @@ function Invoke-EMAuthenticateToMSAL
{
param($params = @{})
$global:EMViewObject.AppInfo = Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" "EM"
$global:EMViewObject.AppInfo = Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp "EM"
Set-MSALCurrentApp $global:EMViewObject.AppInfo
& $global:msalAuthenticator.Login -Account (?? $global:MSALToken.Account.UserName (Get-Setting "" "LastLoggedOnUser")) @params
}
@@ -818,7 +834,7 @@ function Invoke-EMActivatingView
Show-MSALError
# Refresh values in case they have changed
$global:EMViewObject.AppInfo = (Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" "EM")
$global:EMViewObject.AppInfo = (Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp "EM")
if(-not $global:EMViewObject.Authentication)
{
$global:EMViewObject.Authentication = Get-MSALAuthenticationObject
@@ -830,7 +846,7 @@ function Invoke-EMActivatingView
function Invoke-EMSaveSettings
{
$tmpApp = Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547"
$tmpApp = Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp
if($global:appObj.ClientID -ne $tmpApp.ClientId -and $global:MSALToken)
{
@@ -2011,6 +2027,10 @@ function local:Start-ImportApp
{
$fileEncryptionInfo = Copy-MSILOB $packageFile $obj
}
elseif($appType -eq "microsoft.graph.windowsUniversalAppX")
{
$fileEncryptionInfo = Copy-MSIXLOB $packageFile $obj
}
elseif($appType -eq "microsoft.graph.iosLOBApp")
{
$fileEncryptionInfo = Copy-iOSLOB $packageFile $obj

View File

@@ -10,7 +10,7 @@ This module is for the Endpoint Info View. It shows read-only objects in Intune
#>
function Get-ModuleVersion
{
'3.9.0'
'3.9.6'
}
function Invoke-InitializeModule
@@ -27,7 +27,7 @@ function Invoke-InitializeModule
Activating = { Invoke-EMInfoActivatingView }
Authentication = (Get-MSALAuthenticationObject)
Authenticate = { Invoke-EMInfoAuthenticateToMSAL }
AppInfo = (Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" "EM")
AppInfo = (Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp "EM")
SaveSettings = { Invoke-EMSaveSettings }
Permissions = @()
})
@@ -119,7 +119,7 @@ function Invoke-EMInfoActivatingView
function Invoke-EMInfoAuthenticateToMSAL
{
$global:EMInfoViewObject.AppInfo = Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" "EM"
$global:EMInfoViewObject.AppInfo = Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp "EM"
Set-MSALCurrentApp $global:EMInfoViewObject.AppInfo
$usr = (?? $global:MSALToken.Account.UserName (Get-Setting "" "LastLoggedOnUser"))
if($usr)

View File

@@ -10,7 +10,7 @@ This module manages Application objects in Intune e.g. uploading application fil
#>
function Get-ModuleVersion
{
'3.9.3'
'3.9.6'
}
#########################################################################################
@@ -123,6 +123,42 @@ function Copy-MSILOB
$fileEncryptionInfo
}
function Copy-MSIXLOB
{
param($msixFile, $appObj)
if(-not $msixFile -or (Test-Path $msixFile) -eq $false)
{
return
}
$fi = [IO.FileInfo]$msixFile
$appId = $appObj.Id
$appType = $appObj.'@odata.type'.Trim('#')
$tmpFile = [IO.Path]::GetTempFileName()
$fileEncryptionInfo = New-IntuneEncryptedFile $msixFile $tmpFile
$manifest = $fi.Name
$appFileBody = @{
"@odata.type" = "#microsoft.graph.mobileAppContentFile"
name = [IO.Path]::GetFileName($msixFile)
size = (Get-Item $msixFile).Length
sizeEncrypted = (Get-Item $tmpFile).Length
manifest = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($manifest))
isDependency = $false
}
Add-FileToIntuneApp $appId $appType $tmpFile $appFileBody
Remove-Item $tmpFile -Force
$fileEncryptionInfo
}
function Copy-iOSLOB
{
param($pkgFile, $appObj)

View File

@@ -22,7 +22,7 @@ $global:EMToolsViewObject = $null
function Get-ModuleVersion
{
'1.0.4'
'1.0.5'
}
function Invoke-InitializeModule
@@ -82,7 +82,7 @@ function Add-EMToolsViewItem
Activating = { Invoke-EMToolsActivatingView }
Authentication = (Get-MSALAuthenticationObject)
Authenticate = { Invoke-EMToolsAuthenticateToMSAL }
AppInfo = (Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547")
AppInfo = (Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp)
SaveSettings = { Invoke-EMSaveSettings }
Permissions = @()
})
@@ -121,7 +121,7 @@ function Invoke-EMToolsActivatingView
function Invoke-EMToolsAuthenticateToMSAL
{
$global:EMToolsViewObject.AppInfo = Get-GraphAppInfo "EMAzureApp" "d1ddf0e4-d672-4dae-b554-9d5bdfd93547"
$global:EMToolsViewObject.AppInfo = Get-GraphAppInfo "EMAzureApp" $global:DefaultAzureApp
Set-MSALCurrentApp $global:EMToolsViewObject.AppInfo
$usr = (?? $global:MSALToken.Account.UserName (Get-Setting "" "LastLoggedOnUser"))
if($usr)

View File

@@ -10,15 +10,19 @@ This module manages Microsoft Grap fuctions like calling APIs, managing graph ob
#>
function Get-ModuleVersion
{
'3.9.5'
'3.9.6'
}
$global:MSGraphGlobalApps = @(
(New-Object PSObject -Property @{Name="";ClientId="";RedirectUri="";Authority=""}),
(New-Object PSObject -Property @{Name="Microsoft Intune PowerShell";ClientId="d1ddf0e4-d672-4dae-b554-9d5bdfd93547";RedirectUri="urn:ietf:wg:oauth:2.0:oob"; }),
(New-Object PSObject -Property @{Name="Microsoft Graph PowerShell";ClientId="14d82eec-204b-4c2f-b7e8-296a70dab67e";RedirectUri="https://login.microsoftonline.com/common/oauth2/nativeclient";})
(New-Object PSObject -Property @{Name="Microsoft Graph PowerShell";ClientId="14d82eec-204b-4c2f-b7e8-296a70dab67e";RedirectUri="https://login.microsoftonline.com/common/oauth2/nativeclient";}),
(New-Object PSObject -Property @{Name="Decomissioned - Don't use - Microsoft Intune PowerShell";ClientId="d1ddf0e4-d672-4dae-b554-9d5bdfd93547";RedirectUri="urn:ietf:wg:oauth:2.0:oob"; })
)
$global:DefaultAzureApp = "14d82eec-204b-4c2f-b7e8-296a70dab67e"
$global:OldAzureApps = @("d1ddf0e4-d672-4dae-b554-9d5bdfd93547")
function Invoke-InitializeModule
{
$global:graphURL = "https://graph.microsoft.com/beta"