3.1.6
This commit is contained in:
@@ -12,7 +12,7 @@ This module handles the WPF UI
|
|||||||
|
|
||||||
function Get-ModuleVersion
|
function Get-ModuleVersion
|
||||||
{
|
{
|
||||||
'3.1.2'
|
'3.1.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
function Start-CoreApp
|
function Start-CoreApp
|
||||||
@@ -658,8 +658,7 @@ function Remove-InvalidFileNameChars
|
|||||||
$re = "[{0}]" -f [RegEx]::Escape(([IO.Path]::GetInvalidFileNameChars() -join ''))
|
$re = "[{0}]" -f [RegEx]::Escape(([IO.Path]::GetInvalidFileNameChars() -join ''))
|
||||||
|
|
||||||
$Name = $Name -replace $re
|
$Name = $Name -replace $re
|
||||||
$Name = $Name -replace "[]]", ""
|
|
||||||
$Name = $Name -replace "[[]", ""
|
|
||||||
|
|
||||||
return $Name
|
return $Name
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Objects can be compared based on Properties or Documentatation info.
|
|||||||
|
|
||||||
function Get-ModuleVersion
|
function Get-ModuleVersion
|
||||||
{
|
{
|
||||||
'1.0.3'
|
'1.0.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
function Invoke-InitializeModule
|
function Invoke-InitializeModule
|
||||||
@@ -631,7 +631,7 @@ function Save-BulkCompareResults
|
|||||||
if($compResultValues.Count -gt 0)
|
if($compResultValues.Count -gt 0)
|
||||||
{
|
{
|
||||||
Write-Log "Save bulk comare results to $file"
|
Write-Log "Save bulk comare results to $file"
|
||||||
$compResultValues | Select -Property $props | ConvertTo-Csv -NoTypeInformation | Out-File $file -Force -Encoding UTF8
|
$compResultValues | Select -Property $props | ConvertTo-Csv -NoTypeInformation | Out-File -LiteralPath $file -Force -Encoding UTF8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,7 +677,7 @@ function Show-CompareForm
|
|||||||
if($sf.ShowDialog() -eq "OK")
|
if($sf.ShowDialog() -eq "OK")
|
||||||
{
|
{
|
||||||
$csvInfo = Get-CompareCsvInfo $global:dgCompareInfo.ItemsSource $script:cmpForm.Tag
|
$csvInfo = Get-CompareCsvInfo $global:dgCompareInfo.ItemsSource $script:cmpForm.Tag
|
||||||
$csvInfo | Out-File $sf.FileName -Force -Encoding UTF8
|
$csvInfo | Out-File -LiteralPath $sf.FileName -Force -Encoding UTF8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -789,7 +789,7 @@ function Start-CompareExportObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$compareObj = Get-Content $global:txtCompareFile.Text | ConvertFrom-Json
|
$compareObj = Get-Content -LiteralPath $global:txtCompareFile.Text | ConvertFrom-Json
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ $global:documentationProviders = @()
|
|||||||
|
|
||||||
function Get-ModuleVersion
|
function Get-ModuleVersion
|
||||||
{
|
{
|
||||||
'1.0.2'
|
'1.0.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
function Invoke-InitializeModule
|
function Invoke-InitializeModule
|
||||||
@@ -681,10 +681,14 @@ function Invoke-TranslateADMXObject
|
|||||||
#$presentationValues = (Invoke-GraphRequest -Url "$($definitionValue.'definition@odata.bind')/presentations?`$expand=presentation" -ODataMetadata "minimal").value
|
#$presentationValues = (Invoke-GraphRequest -Url "$($definitionValue.'definition@odata.bind')/presentations?`$expand=presentation" -ODataMetadata "minimal").value
|
||||||
$presentationValues = $definitionValue.presentationValues
|
$presentationValues = $definitionValue.presentationValues
|
||||||
}
|
}
|
||||||
else
|
elseif($definitionValue.id)
|
||||||
{
|
{
|
||||||
$presentationValues = (Invoke-GraphRequest -Url "/deviceManagement/groupPolicyConfigurations/$($obj.id)/definitionValues/$($definitionValue.id)/presentationValues?`$expand=presentation" -ODataMetadata "minimal" @params).value
|
$presentationValues = (Invoke-GraphRequest -Url "/deviceManagement/groupPolicyConfigurations/$($obj.id)/definitionValues/$($definitionValue.id)/presentationValues?`$expand=presentation" -ODataMetadata "minimal" @params).value
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$presentationValues = $null
|
||||||
|
}
|
||||||
|
|
||||||
$value = $null
|
$value = $null
|
||||||
$rawValues = @()
|
$rawValues = @()
|
||||||
@@ -3674,7 +3678,9 @@ function Invoke-CSVProcessItem
|
|||||||
$itemsToExport = $itemsToExport | Select Name,Value | ConvertTo-Csv -NoTypeInformation
|
$itemsToExport = $itemsToExport | Select Name,Value | ConvertTo-Csv -NoTypeInformation
|
||||||
}
|
}
|
||||||
|
|
||||||
$itemsToExport | Out-File ($folder + "\$($objName).csv") -Encoding UTF8 -Force
|
$fileName = $folder + "\$((Remove-InvalidFileNameChars $objName)).csv"
|
||||||
|
Write-Log "Save documentation to $fileName"
|
||||||
|
$itemsToExport | Out-File -LiteralPath $fileName -Encoding UTF8 -Force
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ This module will also document some objects based on PowerShell functions
|
|||||||
|
|
||||||
function Get-ModuleVersion
|
function Get-ModuleVersion
|
||||||
{
|
{
|
||||||
'1.0.1'
|
'1.0.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
function Invoke-InitializeModule
|
function Invoke-InitializeModule
|
||||||
@@ -76,6 +76,16 @@ function Invoke-CDDocumentObject
|
|||||||
Properties = @("Name","Value","Category","SubCategory")
|
Properties = @("Name","Value","Category","SubCategory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif($type -eq '#microsoft.graph.windows10CustomConfiguration' -or
|
||||||
|
$type -eq '#microsoft.graph.androidForWorkCustomConfiguration' -or
|
||||||
|
$type -eq '#microsoft.graph.androidWorkProfileCustomConfiguration' -or
|
||||||
|
$type -eq '#microsoft.graph.androidCustomConfiguration')
|
||||||
|
{
|
||||||
|
Invoke-CDDocumentCustomOMAUri $documentationObj
|
||||||
|
return [PSCustomObject]@{
|
||||||
|
Properties = @("Name","Value","Category","SubCategory")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CDAllManagedApps
|
function Get-CDAllManagedApps
|
||||||
@@ -2069,7 +2079,7 @@ function Invoke-CDDocumentPolicySet
|
|||||||
|
|
||||||
|
|
||||||
###################################################
|
###################################################
|
||||||
# Basic info
|
# Settings
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
$addedSettings = @()
|
$addedSettings = @()
|
||||||
@@ -2145,4 +2155,115 @@ function Get-CDDocumentPolicySetValue
|
|||||||
}
|
}
|
||||||
# ToDo: Add support for all PolicySet items
|
# ToDo: Add support for all PolicySet items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Invoke-CDDocumentCustomOMAUri
|
||||||
|
{
|
||||||
|
param($documentationObj)
|
||||||
|
|
||||||
|
$obj = $documentationObj.Object
|
||||||
|
$objectType = $documentationObj.ObjectType
|
||||||
|
|
||||||
|
$script:objectSeparator = ?? $global:cbDocumentationObjectSeparator.SelectedValue ([System.Environment]::NewLine)
|
||||||
|
$script:propertySeparator = ?? $global:cbDocumentationPropertySeparator.SelectedValue ","
|
||||||
|
|
||||||
|
###################################################
|
||||||
|
# Basic info
|
||||||
|
###################################################
|
||||||
|
|
||||||
|
Add-BasicDefaultValues $obj $objectType
|
||||||
|
#Add-BasicPropertyValue (Get-LanguageString "TableHeaders.configurationType") (Get-LanguageString "PolicyType.custom")
|
||||||
|
|
||||||
|
$platformId = Get-ObjectPlatformFromType $obj
|
||||||
|
Add-BasicPropertyValue (Get-LanguageString "Inputs.platformLabel") (Get-LanguageString "Platform.$platformId")
|
||||||
|
|
||||||
|
###################################################
|
||||||
|
# Settings
|
||||||
|
###################################################
|
||||||
|
|
||||||
|
$addedSettings = @()
|
||||||
|
$category = Get-LanguageString "SettingDetails.customPolicyOMAURISettingsName"
|
||||||
|
|
||||||
|
foreach($setting in $obj.omaSettings)
|
||||||
|
{
|
||||||
|
Add-CustomSettingObject ([PSCustomObject]@{
|
||||||
|
Name = (Get-LanguageString "TableHeaders.name")
|
||||||
|
Value = $setting.displayName
|
||||||
|
EntityKey = "displayName_$($setting.omaUri)"
|
||||||
|
Category = $category
|
||||||
|
SubCategory = $setting.displayName
|
||||||
|
})
|
||||||
|
|
||||||
|
Add-CustomSettingObject ([PSCustomObject]@{
|
||||||
|
Name = (Get-LanguageString "TableHeaders.description")
|
||||||
|
Value = $setting.description
|
||||||
|
EntityKey = "description_$($setting.omaUri)"
|
||||||
|
Category = $category
|
||||||
|
SubCategory = $setting.displayName
|
||||||
|
})
|
||||||
|
|
||||||
|
Add-CustomSettingObject ([PSCustomObject]@{
|
||||||
|
Name = (Get-LanguageString "SettingDetails.oMAURIName")
|
||||||
|
Value = $setting.omaUri
|
||||||
|
EntityKey = "omaUri_$($setting.omaUri)"
|
||||||
|
Category = $category
|
||||||
|
SubCategory = $setting.displayName
|
||||||
|
})
|
||||||
|
|
||||||
|
if($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingString')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.stringName")
|
||||||
|
}
|
||||||
|
elseif($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingBase64')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.base64Name")
|
||||||
|
}
|
||||||
|
elseif($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingBoolean')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.booleanName")
|
||||||
|
}
|
||||||
|
elseif($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingDateTime')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.dateTimeName")
|
||||||
|
}
|
||||||
|
elseif($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingFloatingPoint')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.floatingPointName")
|
||||||
|
}
|
||||||
|
elseif($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingInteger')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.integerName")
|
||||||
|
}
|
||||||
|
elseif($setting.'@OData.Type' -eq '#microsoft.graph.omaSettingStringXml')
|
||||||
|
{
|
||||||
|
$value = (Get-LanguageString "SettingDetails.stringXMLName")
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$value = $null
|
||||||
|
}
|
||||||
|
|
||||||
|
if($value)
|
||||||
|
{
|
||||||
|
Add-CustomSettingObject ([PSCustomObject]@{
|
||||||
|
Name = (Get-LanguageString "SettingDetails.dataTypeName")
|
||||||
|
Value = $value
|
||||||
|
EntityKey = "type_$($setting.omaUri)"
|
||||||
|
Category = $category
|
||||||
|
SubCategory = $setting.displayName
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if($setting.isEncrypted -ne $true)
|
||||||
|
{
|
||||||
|
Add-CustomSettingObject ([PSCustomObject]@{
|
||||||
|
Name = (Get-LanguageString "SettingDetails.valueName")
|
||||||
|
Value = $setting.value
|
||||||
|
EntityKey = "value_$($setting.omaUri)"
|
||||||
|
Category = $category
|
||||||
|
SubCategory = $setting.displayName
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -10,7 +10,7 @@ This module is for the Endpoint Manager/Intune View. It manages Export/Import/Co
|
|||||||
#>
|
#>
|
||||||
function Get-ModuleVersion
|
function Get-ModuleVersion
|
||||||
{
|
{
|
||||||
'3.1.5'
|
'3.1.6'
|
||||||
}
|
}
|
||||||
|
|
||||||
function Invoke-InitializeModule
|
function Invoke-InitializeModule
|
||||||
@@ -249,6 +249,7 @@ function Invoke-InitializeModule
|
|||||||
Id = "AdministrativeTemplates"
|
Id = "AdministrativeTemplates"
|
||||||
API = "/deviceManagement/groupPolicyConfigurations"
|
API = "/deviceManagement/groupPolicyConfigurations"
|
||||||
ViewID = "IntuneGraphAPI"
|
ViewID = "IntuneGraphAPI"
|
||||||
|
PostGetCommand = { Start-PostGetAdministrativeTemplate @args }
|
||||||
PostExportCommand = { Start-PostExportAdministrativeTemplate @args }
|
PostExportCommand = { Start-PostExportAdministrativeTemplate @args }
|
||||||
PostCopyCommand = { Start-PostCopyAdministrativeTemplate @args }
|
PostCopyCommand = { Start-PostCopyAdministrativeTemplate @args }
|
||||||
PostFileImportCommand = { Start-PostFileImportAdministrativeTemplate @args }
|
PostFileImportCommand = { Start-PostFileImportAdministrativeTemplate @args }
|
||||||
@@ -789,7 +790,8 @@ function Start-PostExportEndpointSecurity
|
|||||||
|
|
||||||
$settings = Invoke-GraphRequest -Url "$($objectType.API)/$($obj.id)/settings"
|
$settings = Invoke-GraphRequest -Url "$($objectType.API)/$($obj.id)/settings"
|
||||||
$settingsJson = "{ `"settings`": $((ConvertTo-Json $settings.value -Depth 10 ))`n}"
|
$settingsJson = "{ `"settings`": $((ConvertTo-Json $settings.value -Depth 10 ))`n}"
|
||||||
$settingsJson | Out-File "$path\$((Get-GraphObjectName $obj $objectType))_Settings.json" -Force
|
$fileName = "$path\$((Remove-InvalidFileNameChars (Get-GraphObjectName $obj $objectType)))_Settings.json"
|
||||||
|
$settingsJson | Out-File -LiteralPath $fileName -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
function Start-PostFileImportEndpointSecurity
|
function Start-PostFileImportEndpointSecurity
|
||||||
@@ -842,7 +844,7 @@ function Start-PostFileImportDeviceConfiguration
|
|||||||
|
|
||||||
if($obj.'@OData.Type' -like "#microsoft.graph.windows10GeneralConfiguration")
|
if($obj.'@OData.Type' -like "#microsoft.graph.windows10GeneralConfiguration")
|
||||||
{
|
{
|
||||||
$tmpObj = Get-Content $importFile | ConvertFrom-Json
|
$tmpObj = Get-Content -LiteralPath $importFile | ConvertFrom-Json
|
||||||
|
|
||||||
if(($tmpObj.privacyAccessControls | measure).Count -gt 0)
|
if(($tmpObj.privacyAccessControls | measure).Count -gt 0)
|
||||||
{
|
{
|
||||||
@@ -976,7 +978,7 @@ function Start-PostExportIntuneBranding
|
|||||||
{
|
{
|
||||||
if($obj.$imgType.Value)
|
if($obj.$imgType.Value)
|
||||||
{
|
{
|
||||||
$fileName = "$path\$((Remove-InvalidFileNameChars (Get-GraphObjectName $obj $objectType)))_$imgType.jpg"
|
$fileName = "$path\$((Get-GraphObjectName $obj $objectType))_$imgType.jpg"
|
||||||
[IO.File]::WriteAllBytes($fileName, [System.Convert]::FromBase64String($obj.$imgType.Value))
|
[IO.File]::WriteAllBytes($fileName, [System.Convert]::FromBase64String($obj.$imgType.Value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1095,7 +1097,7 @@ function Start-PostExportScripts
|
|||||||
{
|
{
|
||||||
Write-Log "Export script $($obj.FileName)"
|
Write-Log "Export script $($obj.FileName)"
|
||||||
$fileName = [IO.Path]::Combine($exportPath, $obj.FileName)
|
$fileName = [IO.Path]::Combine($exportPath, $obj.FileName)
|
||||||
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($obj.scriptContent)) | Out-File $fileName -Force
|
[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String($obj.scriptContent)) | Out-File -LiteralPath $fileName -Force
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1280,7 +1282,7 @@ function Start-PostFileImportApplications
|
|||||||
{
|
{
|
||||||
param($obj, $objectType, $file)
|
param($obj, $objectType, $file)
|
||||||
|
|
||||||
$tmpObj = Get-Content $file | ConvertFrom-Json
|
$tmpObj = Get-Content -LiteralPath $file | ConvertFrom-Json
|
||||||
|
|
||||||
if(-not $tmpObj.'@odata.type') { return }
|
if(-not $tmpObj.'@odata.type') { return }
|
||||||
|
|
||||||
@@ -1405,7 +1407,8 @@ function Start-PostExportAdministrativeTemplate
|
|||||||
|
|
||||||
# Collect and save all the settings of the Administrative Templates profile
|
# Collect and save all the settings of the Administrative Templates profile
|
||||||
$settings = Get-GPOObjectSettings $obj
|
$settings = Get-GPOObjectSettings $obj
|
||||||
ConvertTo-Json $settings -Depth 10 | Out-File "$path\$((Get-GraphObjectName $obj $objectType))_Settings.json" -Force
|
$fileName = "$path\$((Remove-InvalidFileNameChars (Get-GraphObjectName $obj $objectType)))_Settings.json"
|
||||||
|
ConvertTo-Json $settings -Depth 10 | Out-File -LiteralPath $fileName -Force
|
||||||
}
|
}
|
||||||
|
|
||||||
function Start-PostCopyAdministrativeTemplate
|
function Start-PostCopyAdministrativeTemplate
|
||||||
@@ -1439,7 +1442,7 @@ function Start-LoadAdministrativeTemplate
|
|||||||
$fi = [IO.FileInfo]$fileName
|
$fi = [IO.FileInfo]$fileName
|
||||||
if($fi.Exists -eq $false) { return }
|
if($fi.Exists -eq $false) { return }
|
||||||
|
|
||||||
$obj = Get-Content $fi.FullName | ConvertFrom-Json
|
$obj = Get-Content -LiteralPath $fi.FullName | ConvertFrom-Json
|
||||||
|
|
||||||
if($obj.definitionValues)
|
if($obj.definitionValues)
|
||||||
{
|
{
|
||||||
@@ -1450,13 +1453,34 @@ function Start-LoadAdministrativeTemplate
|
|||||||
|
|
||||||
if([IO.File]::Exists($settingsFile))
|
if([IO.File]::Exists($settingsFile))
|
||||||
{
|
{
|
||||||
$definitionValues = Get-Content $settingsFile | ConvertFrom-Json
|
$definitionValues = Get-Content -LiteralPath $settingsFile | ConvertFrom-Json
|
||||||
|
|
||||||
$obj | Add-Member Noteproperty -Name "definitionValues" -Value $definitionValues -Force
|
$obj | Add-Member Noteproperty -Name "definitionValues" -Value $definitionValues -Force
|
||||||
}
|
}
|
||||||
$obj
|
$obj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Start-PostGetAdministrativeTemplate
|
||||||
|
{
|
||||||
|
param($obj, $objectType)
|
||||||
|
|
||||||
|
$definitionValues = Get-GPOObjectSettings $obj.Object
|
||||||
|
if($definitionValues)
|
||||||
|
{
|
||||||
|
$obj.Object | Add-Member Noteproperty -Name "definitionValues" -Value $definitionValues -Force
|
||||||
|
}
|
||||||
|
<#
|
||||||
|
# Leave for now. This only loads the configured defenition values and not the values specified.
|
||||||
|
# That would require enumerating each definition value which takes time.
|
||||||
|
$definitionValues = (Invoke-GraphRequest "deviceManagement/groupPolicyConfigurations('$($obj.Id)')/definitionValues?`$expand=definition(`$select=id,classType,displayName,policyType,groupPolicyCategoryId)" -ODataMetadata "minimal").value
|
||||||
|
|
||||||
|
if($definitionValues)
|
||||||
|
{
|
||||||
|
$obj.Object | Add-Member Noteproperty -Name "definitionValues" -Value $definitionValues -Force
|
||||||
|
}
|
||||||
|
#>
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Policy Sets function
|
#region Policy Sets function
|
||||||
@@ -1510,8 +1534,8 @@ function Start-PostExportRoleDefinitions
|
|||||||
{
|
{
|
||||||
param($obj, $objectType, $path)
|
param($obj, $objectType, $path)
|
||||||
|
|
||||||
$fileName = "$path\$((Get-GraphObjectName $obj $objectType)).json"
|
$fileName = "$path\$((Remove-InvalidFileNameChars (Get-GraphObjectName $obj $objectType))).json"
|
||||||
$tmpObj = Get-Content $fileName | ConvertFrom-Json
|
$tmpObj = Get-Content -LiteralPath $fileName | ConvertFrom-Json
|
||||||
|
|
||||||
if(($tmpObj.RoleAssignments | measure).Count -gt 0)
|
if(($tmpObj.RoleAssignments | measure).Count -gt 0)
|
||||||
{
|
{
|
||||||
@@ -1530,7 +1554,7 @@ function Start-PostExportRoleDefinitions
|
|||||||
if($roleAssignmentsArr.Count -gt 0)
|
if($roleAssignmentsArr.Count -gt 0)
|
||||||
{
|
{
|
||||||
$tmpObj.RoleAssignments = $roleAssignmentsArr
|
$tmpObj.RoleAssignments = $roleAssignmentsArr
|
||||||
$tmpObj | ConvertTo-Json -Depth 10 | Out-File $fileName
|
$tmpObj | ConvertTo-Json -Depth 10 | Out-File -LiteralPath $fileName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1547,7 +1571,7 @@ function Start-PostFileImportRoleDefinitions
|
|||||||
{
|
{
|
||||||
param($obj, $objectType, $file)
|
param($obj, $objectType, $file)
|
||||||
|
|
||||||
$tmpObj = Get-Content $file | ConvertFrom-Json
|
$tmpObj = Get-Content -LiteralPath $file | ConvertFrom-Json
|
||||||
|
|
||||||
$loadedScopeTags = $global:LoadedDependencyObjects["ScopeTags"]
|
$loadedScopeTags = $global:LoadedDependencyObjects["ScopeTags"]
|
||||||
if(($tmpObj.RoleAssignments | measure).Count -gt 0 -and ($loadedScopeTags | measure).Count -gt 0)
|
if(($tmpObj.RoleAssignments | measure).Count -gt 0 -and ($loadedScopeTags | measure).Count -gt 0)
|
||||||
@@ -1743,9 +1767,12 @@ function Save-EMDefaultPolicy
|
|||||||
if($fileName)
|
if($fileName)
|
||||||
{
|
{
|
||||||
$oldFile = "$path\$((Get-GraphObjectName $obj $objectType)).json"
|
$oldFile = "$path\$((Get-GraphObjectName $obj $objectType)).json"
|
||||||
|
if([IO.File]::Exists($oldFile))
|
||||||
|
{
|
||||||
|
# Clean up from old version of the script that used the wrong name for Default policies
|
||||||
try { [IO.File]::Delete($oldFile) | Out-Null } Catch {}
|
try { [IO.File]::Delete($oldFile) | Out-Null } Catch {}
|
||||||
|
}
|
||||||
$obj | ConvertTo-Json -Depth 10 | Out-File "$path\$fileName.json"
|
$obj | ConvertTo-Json -Depth 10 | Out-File -LiteralPath "$path\$((Remove-InvalidFileNameChars $fileName)).json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch {}
|
catch {}
|
||||||
@@ -1769,7 +1796,7 @@ function Get-EMSettingsObject
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
(Get-Content $fiSettings.FullName) | ConvertFrom-Json
|
(Get-Content -LiteralPath $fiSettings.FullName) | ConvertFrom-Json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1781,8 +1808,13 @@ function Add-EMAssignmentsToExportFile
|
|||||||
{
|
{
|
||||||
param($obj, $objectType, $path, $Url = "")
|
param($obj, $objectType, $path, $Url = "")
|
||||||
|
|
||||||
$fileName = "$path\$((Get-GraphObjectName $obj $objectType)).json"
|
$fileName = "$path\$((Remove-InvalidFileNameChars (Get-GraphObjectName $obj $objectType))).json"
|
||||||
$tmpObj = Get-Content $fileName | ConvertFrom-Json
|
if([IO.File]::Exists($fileName) -eq $false)
|
||||||
|
{
|
||||||
|
Write-Log "File not found: $fileName. Could not add assignments" 3
|
||||||
|
return
|
||||||
|
}
|
||||||
|
$tmpObj = Get-Content -LiteralPath $fileName | ConvertFrom-Json
|
||||||
|
|
||||||
if(-not $url)
|
if(-not $url)
|
||||||
{
|
{
|
||||||
@@ -1799,7 +1831,7 @@ function Add-EMAssignmentsToExportFile
|
|||||||
{
|
{
|
||||||
$tmpObj.Assignments = $assignments
|
$tmpObj.Assignments = $assignments
|
||||||
}
|
}
|
||||||
ConvertTo-Json $tmpObj -Depth 10 | Out-File $fileName -Force
|
ConvertTo-Json $tmpObj -Depth 10 | Out-File -LiteralPath $fileName -Force
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ This module manages Authentication for the application with MSAL. It is also res
|
|||||||
#>
|
#>
|
||||||
function Get-ModuleVersion
|
function Get-ModuleVersion
|
||||||
{
|
{
|
||||||
'3.0.2'
|
'3.0.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
$global:msalAuthenticator = $null
|
$global:msalAuthenticator = $null
|
||||||
@@ -831,6 +831,7 @@ function Connect-MSALUser
|
|||||||
|
|
||||||
Write-LogDebug "User, tenant or app has changed"
|
Write-LogDebug "User, tenant or app has changed"
|
||||||
Get-MSALUserInfo
|
Get-MSALUserInfo
|
||||||
|
Invoke-ModuleFunction "Invoke-GraphAuthenticationUpdated"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,6 +124,13 @@ function Get-GraphAppInfo
|
|||||||
$appObj
|
$appObj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Invoke-GraphAuthenticationUpdated
|
||||||
|
{
|
||||||
|
$global:MigrationTableCache = $null
|
||||||
|
$global:LoadedDependencyObjects = $null
|
||||||
|
$global:migFileObj = $null
|
||||||
|
}
|
||||||
|
|
||||||
function Invoke-GraphRequest
|
function Invoke-GraphRequest
|
||||||
{
|
{
|
||||||
param (
|
param (
|
||||||
@@ -661,7 +668,7 @@ function Show-GraphExportForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Add-GraphExportExtensions $script:exportForm 1
|
Add-GraphExportExtensions $script:exportForm 1 $global:curObjectType
|
||||||
|
|
||||||
Show-ModalForm "Export $($global:curObjectType.Title) objects" $script:exportForm -HideButtons
|
Show-ModalForm "Export $($global:curObjectType.Title) objects" $script:exportForm -HideButtons
|
||||||
}
|
}
|
||||||
@@ -695,9 +702,9 @@ function Show-GraphBulkExportForm
|
|||||||
Selected = (?? $objType.BulkExport $true)
|
Selected = (?? $objType.BulkExport $true)
|
||||||
ObjectType = $objType
|
ObjectType = $objType
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Add-GraphExportExtensions $script:exportForm 0
|
Add-GraphExportExtensions $script:exportForm 0 $objType
|
||||||
|
}
|
||||||
|
|
||||||
$column = Get-GridCheckboxColumn "Selected"
|
$column = Get-GridCheckboxColumn "Selected"
|
||||||
$global:dgObjectsToExport.Columns.Add($column)
|
$global:dgObjectsToExport.Columns.Add($column)
|
||||||
@@ -979,12 +986,15 @@ function Show-GraphBulkImportForm
|
|||||||
|
|
||||||
function Add-GraphExportExtensions
|
function Add-GraphExportExtensions
|
||||||
{
|
{
|
||||||
param($form, $buttonIndex = 0)
|
param($form, $buttonIndex = 0, $objectTypes)
|
||||||
|
|
||||||
if($global:curObjectType.ExportExtension)
|
#$global:curObjectType
|
||||||
|
foreach($objectType in $objectTypes)
|
||||||
|
{
|
||||||
|
if($objectType.ExportExtension)
|
||||||
{
|
{
|
||||||
$grid = $form.FindName("grdExportProperties")
|
$grid = $form.FindName("grdExportProperties")
|
||||||
$extraProperties = & $global:curObjectType.ExportExtension $global:curObjectType.ExportExtension $form "spExportSubMenu" 1
|
$extraProperties = & $objectType.ExportExtension $form "spExportSubMenu" 1
|
||||||
for($i=0;($i + 1) -lt (($extraProperties) | measure).Count;$i ++)
|
for($i=0;($i + 1) -lt (($extraProperties) | measure).Count;$i ++)
|
||||||
{
|
{
|
||||||
$rd = [System.Windows.Controls.RowDefinition]::new()
|
$rd = [System.Windows.Controls.RowDefinition]::new()
|
||||||
@@ -1001,6 +1011,7 @@ function Add-GraphExportExtensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function Add-GraphImportExtensions
|
function Add-GraphImportExtensions
|
||||||
{
|
{
|
||||||
@@ -1155,7 +1166,7 @@ function Get-GraphFileObjects
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$graphObj = (ConvertFrom-Json (Get-Content $file.FullName -Raw))
|
$graphObj = (ConvertFrom-Json (Get-Content -LiteralPath $file.FullName -Raw))
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj = New-Object PSObject -Property @{
|
$obj = New-Object PSObject -Property @{
|
||||||
@@ -1470,6 +1481,11 @@ function Add-GraphMigrationObject
|
|||||||
|
|
||||||
$migFileName = Join-Path $path "MigrationTable.json"
|
$migFileName = Join-Path $path "MigrationTable.json"
|
||||||
|
|
||||||
|
if($global:migFileObj -and $global:migFileObj.TenantId -ne $global:organization.Id)
|
||||||
|
{
|
||||||
|
$global:migFileObj = $null
|
||||||
|
}
|
||||||
|
|
||||||
if(-not $global:migFileObj)
|
if(-not $global:migFileObj)
|
||||||
{
|
{
|
||||||
if(-not ([IO.File]::Exists($migFileName)))
|
if(-not ([IO.File]::Exists($migFileName)))
|
||||||
@@ -1572,14 +1588,14 @@ function Get-GraphMigrationObjectsFromFile
|
|||||||
if($global:GraphMigrationTable)
|
if($global:GraphMigrationTable)
|
||||||
{
|
{
|
||||||
$fi = [IO.FileInfo]$global:GraphMigrationTable
|
$fi = [IO.FileInfo]$global:GraphMigrationTable
|
||||||
$groupFi = [IO.FileInfo]($fi.DirectoryName + "\Groups\$($migObj.DisplayName).json")
|
$groupFi = [IO.FileInfo]($fi.DirectoryName + "\Groups\$((Remove-InvalidFileNameChars $migObj.DisplayName)).json")
|
||||||
}
|
}
|
||||||
|
|
||||||
if($groupFi.Exists -eq $true)
|
if($groupFi.Exists -eq $true)
|
||||||
{
|
{
|
||||||
# ToDo: Create group from Json (could be a dynamic group)
|
# ToDo: Create group from Json (could be a dynamic group)
|
||||||
# Warn if synched group
|
# Warn if synched group
|
||||||
$groupObj = (Get-Content $groupFi.FullName) | ConvertFrom-Json
|
$groupObj = (Get-Content -LiteralPath $groupFi.FullName) | ConvertFrom-Json
|
||||||
|
|
||||||
#isAssignableToRole - For Role assignment groupd.
|
#isAssignableToRole - For Role assignment groupd.
|
||||||
$keepProps = @("displayName","description","mailEnabled","mailNickname","securityEnabled","membershipRule","groupTypes", "membershipRuleProcessingState")
|
$keepProps = @("displayName","description","mailEnabled","mailNickname","securityEnabled","membershipRule","groupTypes", "membershipRuleProcessingState")
|
||||||
@@ -1832,7 +1848,8 @@ function Export-GraphObject
|
|||||||
Remove-Property $obj "Assignments"
|
Remove-Property $obj "Assignments"
|
||||||
}
|
}
|
||||||
|
|
||||||
$obj | ConvertTo-Json -Depth 10 | Out-File ([IO.Path]::Combine($exportFolder, (Remove-InvalidFileNameChars "$((Get-GraphObjectName $obj $objectType)).json")))
|
#$obj | ConvertTo-Json -Depth 10 | Out-File ([IO.Path]::Combine($exportFolder, (Remove-InvalidFileNameChars "$((Get-GraphObjectName $obj $objectType)).json")))
|
||||||
|
$obj | ConvertTo-Json -Depth 10 | Out-File -LiteralPath ([IO.Path]::Combine($exportFolder, (Remove-InvalidFileNameChars "$((Get-GraphObjectName $obj $objectType)).json")))
|
||||||
|
|
||||||
if($objectType.PostExportCommand)
|
if($objectType.PostExportCommand)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
|
## 3.1.6 - 2021-07-07
|
||||||
|
|
||||||
|
**Fixes**
|
||||||
|
|
||||||
|
* Fixed invalid file name characters - [Issue 19](https://github.com/Micke-K/IntuneManagement/issues/19)
|
||||||
|
|
||||||
|
* Added -LiteralPath to Get and Set-Content
|
||||||
|
* Save CSV in document
|
||||||
|
* Import/Export Administrative Template and Role Definitions
|
||||||
|
* Saving the PowerShell script file
|
||||||
|
* Export with assignments for multiple profiles
|
||||||
|
|
||||||
|
* Added support for [ and ] in file names
|
||||||
|
|
||||||
|
**Note:** This can cause duplicate files if exporting to the same location as pre 3.1.6 export and the profile name contains [ or ]
|
||||||
|
|
||||||
|
* Changed to custom documentation for Custom OMA-URI profiles
|
||||||
|
|
||||||
|
* Administrative Template now includes definitionValues in detailed view and export
|
||||||
|
|
||||||
|
* Fixed exporting PowerShell script in Bulk export. Option was only available if PowerShell was active type.
|
||||||
|
|
||||||
|
* Fixed issue with MigrationTable when exporting from two different environments without restart. The Group information was save to the same MigrationTable.
|
||||||
|
|
||||||
## 3.1.5 - 2021-07-06
|
## 3.1.5 - 2021-07-06
|
||||||
|
|
||||||
**Fixes**
|
**Fixes**
|
||||||
|
|||||||
Reference in New Issue
Block a user