Skip to content

Commit

Permalink
3.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Micke-K committed Dec 11, 2023
1 parent ab7b062 commit f561344
Show file tree
Hide file tree
Showing 15 changed files with 824 additions and 93 deletions.
4 changes: 2 additions & 2 deletions CloudAPIPowerShellManagement.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'CloudAPIPowerShellManagement.psm1'

# Version number of this module.
ModuleVersion = '3.9.2'
ModuleVersion = '3.9.3'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -69,7 +69,7 @@ Description = 'Management of Intune and Azure via Cloud APIs like Microsoft Grap
NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @("Initialize-CloudAPIManagement","Initialize-CloudAPIManagement")
FunctionsToExport = @("Initialize-CloudAPIManagement")

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
# CmdletsToExport = @()
Expand Down
35 changes: 32 additions & 3 deletions Core.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This module handles the WPF UI

function Get-ModuleVersion
{
'3.9.2'
'3.9.3'
}

function Initialize-Window
Expand Down Expand Up @@ -2069,7 +2069,7 @@ function Add-SettingsObject
$section.Values += $obj
}
catch { }
}
}

function Save-AllSettings
{
Expand Down Expand Up @@ -2797,7 +2797,17 @@ function Start-DownloadFile

try
{
Write-Status "Download file: `n$sourceURL"
$title = $sourceURL.Split("/")[-1]
$title = $title.Split("/")[0]
}
catch
{
$title = $sourceURL
}

try
{
Write-Status "Download file: `n$title"
$wc.DownloadFile($sourceURL, $targetFile)
Write-Log "File downloaded to $targetFile"
}
Expand Down Expand Up @@ -2831,6 +2841,25 @@ function Get-ASCIIBytes
$bytes
}

function Get-DataGridValues
{
param($dataGrid)

$dgColumns = $dataGrid.Columns

$properties = @()

foreach($tmpCol in $dgColumns)
{
if(-not $tmpCol.Binding.Path.Path) { continue }
$propName = $tmpCol.Binding.Path.Path
$properties += @{n=$tmpCol.Header;e=([Scriptblock]::Create("`$_.$propName"))}
}

($dataGrid.ItemsSource | Select -Property $properties)
}


New-Alias -Name ?? -value Invoke-Coalesce
New-Alias -Name ?: -value Invoke-IfTrue
Export-ModuleMember -alias * -function *
27 changes: 23 additions & 4 deletions Extensions/Documentation.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $global:documentationProviders = @()

function Get-ModuleVersion
{
'2.0.2'
'2.0.3'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -228,6 +228,7 @@ function Get-ObjectDocumentation
$script:applicabilityRules = @()
$script:objectAssignments = @()
$script:objectScripts = @()
$script:admxCategories = $null

$script:ObjectTypeFullTable = @{} # Hash table with objects that should be documented in a single table eg ScopeTags

Expand Down Expand Up @@ -384,6 +385,7 @@ function Invoke-ObjectDocumentation
$global:catRecommendedSettings = $null
$global:intentCategoryDefs = $null
$global:cfgCategories = $null
$script:admxCategories = $null

$script:DocumentationLanguage = "en"
$script:objectSeparator = [System.Environment]::NewLine
Expand Down Expand Up @@ -879,7 +881,8 @@ function Invoke-TranslateADMXObject
{
if(-not $definitionValue.definition -and $definitionValues.'[email protected]')
{
$definition = Invoke-GraphRequest -Url $definitionValue.'[email protected]' -ODataMetadata "minimal" @params
$url = $definitionValue.'[email protected]' -replace $global:graphURL, ("https://$((?? $global:MSALGraphEnvironment "graph.microsoft.com"))/beta")
$definition = Invoke-GraphRequest -Url $url -ODataMetadata "minimal" @params
if($definition)
{
$definitionValue | Add-Member -MemberType NoteProperty -Name "definition" -Value $definition
Expand Down Expand Up @@ -1924,7 +1927,8 @@ function Get-LanguageString

if(-not $script:languageStrings)
{
$fileContent = Get-Content ($global:AppRootFolder + "\Documentation\Strings-$($script:DocumentationLanguage).json") -Encoding UTF8
$lng = ?? $script:DocumentationLanguage "en"
$fileContent = Get-Content ($global:AppRootFolder + "\Documentation\Strings-$($lng).json") -Encoding UTF8
$script:languageStrings = $fileContent | ConvertFrom-Json
}

Expand Down Expand Up @@ -4432,7 +4436,7 @@ function local:Invoke-StartDocumentatiom
# Add each object to the documentation
foreach($curGroupId in ($sourceList.ObjectType | Select GroupID -Unique).GroupID)
{
# New object group e.g. Script, Tennant, Device Configuration
# New object group e.g. Script, Tenant, Device Configuration
# A group matches a menu item in the protal but can contain multiple object types
if($global:cbDocumentationType.SelectedItem.NewObjectGroup)
{
Expand Down Expand Up @@ -5040,4 +5044,19 @@ function Set-TableObjects
{
$script:ObjectTypeFullTable.Add($objectInfo.ObjectType.Id, $objectInfo)
}
}

function Get-PolicyTypeName
{
param($type, $default = $null)

$categoryObj = Get-TranslationFiles $type

if($null -eq $categoryObj) { return $default }

$lngStr = Get-LanguageString "PolicyType.$($categoryObj.PolicyTypeLanguageId)"

if($lngStr) { return $lngStr }

return $defult
}
4 changes: 2 additions & 2 deletions Extensions/DocumentationHTML.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Get-ModuleVersion
{
'1.0.0'
'1.0.1'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -374,7 +374,7 @@ function Invoke-HTMLProcessItem
$isFilterAssignment = $false
foreach($assignment in $documentedObj.Assignments)
{
if(($assignment.target.PSObject.Properties | Where Name -eq "deviceAndAppManagementAssignmentFilterType"))
if(($assignment.PSObject.Properties | Where Name -eq "FilterMode"))
{
$isFilterAssignment = $true
break
Expand Down
4 changes: 2 additions & 2 deletions Extensions/DocumentationMD.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Get-ModuleVersion
{
'1.1.0'
'1.1.1'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -331,7 +331,7 @@ function Invoke-MDProcessItem
$isFilterAssignment = $false
foreach($assignment in $documentedObj.Assignments)
{
if(($assignment.target.PSObject.Properties | Where Name -eq "deviceAndAppManagementAssignmentFilterType"))
if(($assignment.PSObject.Properties | Where Name -eq "FilterMode"))
{
$isFilterAssignment = $true
break
Expand Down
6 changes: 3 additions & 3 deletions Extensions/DocumentationWord.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#https://docs.microsoft.com/en-us/office/vba/api/overview/word
function Get-ModuleVersion
{
'1.5.0'
'1.6.0'
}

function Invoke-InitializeModule
Expand Down Expand Up @@ -600,7 +600,7 @@ function Invoke-WordProcessItem
$isFilterAssignment = $false
foreach($assignment in $documentedObj.Assignments)
{
if(($assignment.target.PSObject.Properties | Where Name -eq "deviceAndAppManagementAssignmentFilterType"))
if(($assignment.PSObject.Properties | Where Name -eq "FilterMode"))
{
$isFilterAssignment = $true
break
Expand Down Expand Up @@ -752,7 +752,7 @@ function Add-DocTableItems

$range = $script:doc.application.selection.range

$script:docTable = $script:doc.Tables.Add($range, ($items.Count + 1), $properties.Count, [Microsoft.Office.Interop.Word.WdDefaultTableBehavior]::wdWord9TableBehavior, [Microsoft.Office.Interop.Word.WdAutoFitBehavior]::wdAutoFitWindow)
$script:docTable = $script:doc.Tables.Add($range, (($items | measure).Count + 1), $properties.Count, [Microsoft.Office.Interop.Word.WdDefaultTableBehavior]::wdWord9TableBehavior, [Microsoft.Office.Interop.Word.WdAutoFitBehavior]::wdAutoFitWindow)
$script:docTable.ApplyStyleHeadingRows = $true
Set-DocObjectStyle $script:docTable $global:txtWordTableStyle.Text | Out-null

Expand Down
Loading

0 comments on commit f561344

Please sign in to comment.