3.2.2
This commit is contained in:
@@ -10,7 +10,7 @@ This module is for the Endpoint Manager/Intune View. It manages Export/Import/Co
|
||||
#>
|
||||
function Get-ModuleVersion
|
||||
{
|
||||
'3.1.10'
|
||||
'3.1.11'
|
||||
}
|
||||
|
||||
function Invoke-InitializeModule
|
||||
@@ -119,6 +119,8 @@ function Invoke-InitializeModule
|
||||
Permissons=@("Policy.Read.All","Policy.ReadWrite.ConditionalAccess","Application.Read.All")
|
||||
Dependencies = @("NamedLocations","Applications")
|
||||
GroupId = "ConditionalAccess"
|
||||
ImportExtension = { Add-ConditionalAccessImportExtensions @args }
|
||||
PreImportCommand = { Start-PreImportConditionalAccess @args }
|
||||
})
|
||||
|
||||
Add-ViewItem (New-Object PSObject -Property @{
|
||||
@@ -2432,5 +2434,61 @@ function Start-PreUpdateFeatureUpdates
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Conditional Access
|
||||
function Add-ConditionalAccessImportExtensions
|
||||
{
|
||||
param($form, $buttonPanel, $index = 0)
|
||||
|
||||
$xaml = @"
|
||||
<StackPanel $($global:wpfNS) Orientation="Horizontal" Margin="0,0,5,0">
|
||||
<Label Content="Conditional Access State" />
|
||||
<Rectangle Style="{DynamicResource InfoIcon}" ToolTip="Specifies the enable state of Conditional Access policies" />
|
||||
</StackPanel>
|
||||
"@
|
||||
$label = [Windows.Markup.XamlReader]::Parse($xaml)
|
||||
|
||||
$CAStates = @()
|
||||
$CAStates += [PSCustomObject]@{
|
||||
Name = "As Exported"
|
||||
Value = "AsExported"
|
||||
}
|
||||
|
||||
$CAStates += [PSCustomObject]@{
|
||||
Name = "Report-only"
|
||||
Value = "enabledForReportingButNotEnforced"
|
||||
}
|
||||
|
||||
$CAStates += [PSCustomObject]@{
|
||||
Name = "On"
|
||||
Value = "enabled"
|
||||
}
|
||||
|
||||
$CAStates += [PSCustomObject]@{
|
||||
Name = "Off"
|
||||
Value = "disabled"
|
||||
}
|
||||
|
||||
$global:cbImportCAState = [System.Windows.Controls.ComboBox]::new()
|
||||
$global:cbImportCAState.DisplayMemberPath = "Name"
|
||||
$global:cbImportCAState.SelectedValuePath = "Value"
|
||||
$global:cbImportCAState.ItemsSource = $CAStates
|
||||
$global:cbImportCAState.SelectedValue = "AsExported"
|
||||
$global:cbImportCAState.Margin="0,5,0,0"
|
||||
$global:cbImportCAState.HorizontalAlignment="Left"
|
||||
$global:cbImportCAState.Width=250
|
||||
|
||||
@($label, $global:cbImportCAState)
|
||||
}
|
||||
|
||||
function Start-PreImportConditionalAccess
|
||||
{
|
||||
param($obj, $objectType, $file, $assignments)
|
||||
|
||||
if($global:cbImportCAState.SelectedValue -and $global:cbImportCAState.SelectedValue -ne "AsExported")
|
||||
{
|
||||
$obj.state = $global:cbImportCAState.SelectedValue
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
Export-ModuleMember -alias * -function *
|
||||
@@ -10,7 +10,7 @@ This module manages Microsoft Grap fuctions like calling APIs, managing graph ob
|
||||
#>
|
||||
function Get-ModuleVersion
|
||||
{
|
||||
'3.1.5'
|
||||
'3.1.6'
|
||||
}
|
||||
|
||||
$global:MSGraphGlobalApps = @(
|
||||
@@ -955,7 +955,7 @@ function Show-GraphImportForm
|
||||
}
|
||||
}
|
||||
|
||||
Add-GraphImportExtensions $script:importForm 1
|
||||
Add-GraphImportExtensions $script:importForm 1 $global:curObjectType
|
||||
|
||||
if($global:txtImportPath.Text)
|
||||
{
|
||||
@@ -1010,9 +1010,9 @@ function Show-GraphBulkImportForm
|
||||
Selected = (?? $objType.BulkImport $true)
|
||||
ObjectType = $objType
|
||||
}
|
||||
}
|
||||
|
||||
Add-GraphImportExtensions $script:importForm 0
|
||||
Add-GraphImportExtensions $script:importForm 0 $objType
|
||||
}
|
||||
|
||||
$column = Get-GridCheckboxColumn "Selected"
|
||||
$global:dgObjectsToImport.Columns.Add($column)
|
||||
@@ -1161,27 +1161,30 @@ function Add-GraphExportExtensions
|
||||
|
||||
function Add-GraphImportExtensions
|
||||
{
|
||||
param($form, $buttonIndex = 0)
|
||||
param($form, $buttonIndex = 0, $objectTypes)
|
||||
|
||||
if($global:curObjectType.ImportExtension)
|
||||
foreach($objectType in $objectTypes)
|
||||
{
|
||||
$grid = $form.FindName("grdImportProperties")
|
||||
$extraProperties = & $global:curObjectType.ExportExtension $global:curObjectType.ExportExtension $form "spExportSubMenu" 1
|
||||
for($i=0;($i + 1) -lt (($extraProperties) | measure).Count;$i ++)
|
||||
{
|
||||
$rd = [System.Windows.Controls.RowDefinition]::new()
|
||||
$rd.Height = [double]::NaN
|
||||
$grid.RowDefinitions.Add($rd)
|
||||
$extraProperties[$i].SetValue([System.Windows.Controls.Grid]::RowProperty,$grid.RowDefinitions.Count)
|
||||
$grid.Children.Add($extraProperties[$i])
|
||||
if($objectType.ImportExtension)
|
||||
{
|
||||
$grid = $form.FindName("grdImportProperties")
|
||||
$extraProperties = & $objectType.ImportExtension $form "spExportSubMenu" 1
|
||||
for($i=0;($i + 1) -lt (($extraProperties) | measure).Count;$i ++)
|
||||
{
|
||||
$rd = [System.Windows.Controls.RowDefinition]::new()
|
||||
$rd.Height = [double]::NaN
|
||||
$grid.RowDefinitions.Add($rd)
|
||||
$extraProperties[$i].SetValue([System.Windows.Controls.Grid]::RowProperty,$grid.RowDefinitions.Count)
|
||||
$grid.Children.Add($extraProperties[$i])
|
||||
|
||||
$i++
|
||||
$extraProperties[$i].SetValue([System.Windows.Controls.Grid]::RowProperty,$grid.RowDefinitions.Count)
|
||||
$extraProperties[$i].SetValue([System.Windows.Controls.Grid]::ColumnProperty,1)
|
||||
$grid.Children.Add($extraProperties[$i])
|
||||
|
||||
$i++
|
||||
$extraProperties[$i].SetValue([System.Windows.Controls.Grid]::RowProperty,$grid.RowDefinitions.Count)
|
||||
$extraProperties[$i].SetValue([System.Windows.Controls.Grid]::ColumnProperty,1)
|
||||
$grid.Children.Add($extraProperties[$i])
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Show-GraphBulkDeleteForm
|
||||
@@ -2234,7 +2237,7 @@ function Import-GraphObject
|
||||
}
|
||||
}
|
||||
|
||||
$json = ConvertTo-Json $obj -Depth 10
|
||||
$json = ConvertTo-Json $obj -Depth 20
|
||||
if($fromFile)
|
||||
{
|
||||
# Call Update-JsonForEnvironment before importing the object
|
||||
|
||||
Reference in New Issue
Block a user