DrawManagement.psd1
|
# # Module manifest for module 'DrawManagement' # Generated by DrawManagement build script # @{ # ── Identity ─────────────────────────────────────────────────────── ModuleVersion = '1.3.1' GUID = 'a3f1c2d4-8b5e-4f7a-9c0d-1e2f3a4b5c6d' Author = 'DrawManagement Contributors' CompanyName = 'Community' Copyright = '(c) 2026 DrawManagement Contributors. MIT License.' Description = @' DrawManagement — A native PowerShell module for creating, editing and managing draw.io (.drawio / mxGraph) diagram files programmatically. Features: • Create and manage multi-page draw.io files entirely in memory • Add shapes from 50+ built-in presets (General, Flowchart, Network, AWS, Azure, Active Directory, VMware VVD) • Add containers (swimlanes), connectors with arrow/style control • Embed Visio stencils (.vssx/.vss) so output files are fully self-contained and portable across machines • Import SVG and PNG/JPEG assets as embedded stencils • UserObject metadata on every shape (owner, version, SLA, repo, etc.) • Tooltip and hyperlink support per shape • File-level placeholder variables (%env%, %version% etc.) • Auto-generate a formatted Legend/Reference page • Full round-trip: Open existing .drawio → modify → Save (geometry, nesting, metadata, tooltips, links and background preserved) • Layout engine: grid pack, layered tier lanes, hub-and-spoke — you supply the grouping, the module supplies the coordinates • Azure catalogue: 49 ARM resource types mapped to draw.io's built-in azure2/mscae icons, tier classification and noise filtering. Pure reference data — never calls Azure, no Az.* dependency. • Built-in shape index: search all ~11,600 shapes draw.io can render without any embedded asset — ~9,100 vector stencils, ~800 JS-registered shapes and ~1,750 SVG icons — with Find-DrawShape. Referencing one costs ~40 bytes of style and keeps the file small and recolourable. Shapes get the colours draw.io's own sidebar gives them. • User icon packs: install a vendor icon set (VMware's official icons, any draw.io library, or one of ~1,000 extra sets on icons.diagrams.net such as Fortinet or Commvault) into your profile and place icons by name — the artwork is never shipped with the module. • Pester 5 test suite included (332 tests) '@ # ── Requirements ─────────────────────────────────────────────────── PowerShellVersion = '7.0' CompatiblePSEditions = @('Core') # [FIX-40] 1.3.1: no ScriptsToProcess. The classes used to be defined in # the importer's scope from here, which broke an import made inside a # function. DrawManagement.psm1 now publishes them as type accelerators. # No external module dependencies — only .NET BCL (always available) # ── Contents ─────────────────────────────────────────────────────── RootModule = 'DrawManagement.psm1' # Explicit function exports (populated by build from Public/*.ps1) FunctionsToExport = @( # DrawFile.ps1 'New-DrawFile' 'Save-DrawFile' 'Open-DrawFile' 'Get-DrawFileInfo' 'Set-DrawFileVar' # DrawPage.ps1 'Add-DrawPage' 'Get-DrawPage' 'Remove-DrawPage' 'Rename-DrawPage' 'Add-DrawLegendPage' 'Copy-DrawPage' # DrawShape.ps1 'Add-DrawShape' 'Add-DrawContainer' 'Add-DrawText' 'Add-DrawEdge' 'Add-DrawBidirectionalEdge' 'Set-DrawCellMetadata' 'Get-DrawShapeTypes' 'Assert-HexColor' # DrawStencil.ps1 'Import-DrawStencilFromVssx' 'Import-DrawStencilFromSvg' 'Import-DrawStencilFromPng' 'New-DrawStencil' 'Get-DrawStencils' 'Remove-DrawStencil' 'Export-DrawStencilLibrary' 'Add-DrawShapeFromStencil' # DrawLayout.ps1 'Measure-DrawGrid' 'Set-DrawGridLayout' 'Set-DrawLayeredLayout' 'Set-DrawHubSpokeLayout' # DrawShapeIndex.ps1 'Find-DrawShape' 'Get-DrawShapeLibrary' 'Get-DrawShapeStyle' 'Add-DrawShapeByName' 'Get-DrawShapeIndexInfo' # DrawIconPack.ps1 'Install-DrawIconPack' 'Find-DrawIconSet' 'Get-DrawIconPack' 'Uninstall-DrawIconPack' 'Add-DrawPackIcon' # DrawAzure.ps1 'Get-DrawAzureStyle' 'Get-DrawAzureTier' 'Get-DrawAzureTierInfo' 'Get-DrawAzureCatalog' 'Test-DrawAzureManagedResourceGroup' 'Select-DrawAzureResource' 'Add-DrawAzureResource' ) CmdletsToExport = @() VariablesToExport = @() AliasesToExport = @() # ── Metadata ─────────────────────────────────────────────────────── PrivateData = @{ PSData = @{ Tags = @('drawio','diagram','mxgraph','visio','vssx','architecture','network','infrastructure','azure','vmware','fortinet','commvault','powershell','documentation') LicenseUri = 'https://github.com/nicola-vi/DrawManagement/blob/main/LICENSE' ProjectUri = 'https://github.com/nicola-vi/DrawManagement' ReleaseNotes = @' v1.3.1 FIXED — the module failed when it was imported from inside a function (any wrapper, e.g. a report framework's module loader): New-DrawFile returned nothing and every cmdlet failed with "Unable to find type [DrawPage]". The classes were defined in the importer's scope by ScriptsToProcess and vanished when that function returned. They are now published as session-wide type accelerators by the module itself (removed again by Remove-Module), so [DrawFile], [DrawPage], [DrawCell], [DrawEdge] and the enums resolve from any scope. Importing the .psm1 directly now works too. 6 new tests (Tests/DrawManagement.ImportScope.Tests.ps1). v1.3.0 NEW — user icon packs: Install-DrawIconPack, Get-DrawIconPack, Uninstall-DrawIconPack, Add-DrawPackIcon, Find-DrawIconSet. Install a folder, zip or URL of SVGs (e.g. VMware's official icon set), any draw.io library (-Library), or a set from icons.diagrams.net by name (-DiagramsNetSet fortinet-products; licence and author recorded) into your profile, then place icons by name; -Reference links instead of embedding. Icons are normalised (natural size, page-sized artboards cropped), recoloured on placement (-Color, pack default, or -KeepColors) and embedded in the diagram. Nothing is written to, or shipped with, the module. CHANGED — Get-DrawShapeStyle and Add-DrawShapeByName now apply the colours draw.io's own sidebar gives each stencil (Data/DrawPaletteColors.json, 4,717 shapes). Fill-only libraries — mxgraph.vvd, veeam2, azure, office, aws4 — previously rendered as a black outline or white-on-white. -Fill/-Stroke still win; -NoPaletteColor returns the bare style. NEW — Add-DrawShapeByName -Size fits the longest side and keeps the aspect ratio; -Width or -Height alone now keeps it too. mxgraph.vvd.server is 5:1 and was squashed into a square by every example. FIXED — VMware (Vm*) and Azure (AzureVM/SQL/Storage) presets drew as a black outline with the label over the glyph, stretched to 120x60. They now carry their colour (VMware blue #0091DA, Azure #00BEF2), put the label below and default to their true proportions. FIXED — file-level vars (New-DrawFile -Vars, Set-DrawFileVar) were never substituted: they were written to <mxfile vars>, which draw.io does not read, so %name% rendered literally. They are now written on each page's root cell, where draw.io resolves placeholders. Open-DrawFile reads both. FIXED — Import-DrawStencilFromVssx aborted on VMware's official vmw_Icons.vssx ("property 'NameU' cannot be found"): a StrictMode read of an optional attribute, repeated inside the error handler. HARDENED — a saved file is always well-formed XML: metadata/vars keys that start with a digit, collide, or match id/label/tooltip are made valid and unique; characters XML forbids are dropped; ids are escaped. Icon packs treat their source as untrusted: content is verified, scripts are stripped from SVGs, file names are safe, bad entries are skipped. Full history: https://github.com/nicola-vi/DrawManagement#changelog '@ } } } |