DrawManagement
1.3.1
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)
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)
Minimum PowerShell version
7.0
Installation Options
Owners
Copyright
(c) 2026 DrawManagement Contributors. MIT License.
Package Details
Author(s)
- DrawManagement Contributors
Tags
drawio diagram mxgraph visio vssx architecture network infrastructure azure vmware fortinet commvault powershell documentation
Functions
New-DrawFile Save-DrawFile Open-DrawFile Get-DrawFileInfo Set-DrawFileVar Add-DrawPage Get-DrawPage Remove-DrawPage Rename-DrawPage Add-DrawLegendPage Copy-DrawPage Add-DrawShape Add-DrawContainer Add-DrawText Add-DrawEdge Add-DrawBidirectionalEdge Set-DrawCellMetadata Get-DrawShapeTypes Assert-HexColor Import-DrawStencilFromVssx Import-DrawStencilFromSvg Import-DrawStencilFromPng New-DrawStencil Get-DrawStencils Remove-DrawStencil Export-DrawStencilLibrary Add-DrawShapeFromStencil Measure-DrawGrid Set-DrawGridLayout Set-DrawLayeredLayout Set-DrawHubSpokeLayout Find-DrawShape Get-DrawShapeLibrary Get-DrawShapeStyle Add-DrawShapeByName Get-DrawShapeIndexInfo Install-DrawIconPack Find-DrawIconSet Get-DrawIconPack Uninstall-DrawIconPack Add-DrawPackIcon Get-DrawAzureStyle Get-DrawAzureTier Get-DrawAzureTierInfo Get-DrawAzureCatalog Test-DrawAzureManagedResourceGroup Select-DrawAzureResource Add-DrawAzureResource
PSEditions
Dependencies
This module has no dependencies.
Release Notes
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
FileList
- DrawManagement.nuspec
- Classes\DrawClasses.ps1
- Data\DrawPaletteColors.json
- Data\DrawShapeIndex.json
- DrawManagement.psd1
- DrawManagement.psm1
- LICENSE
- Private\Helpers.ps1
- Private\IconPack.ps1
- Public\DrawAzure.ps1
- Public\DrawFile.ps1
- Public\DrawIconPack.ps1
- Public\DrawLayout.ps1
- Public\DrawPage.ps1
- Public\DrawShape.ps1
- Public\DrawShapeIndex.ps1
- Public\DrawStencil.ps1
- README.md
- docs\shapes.md
- docs\stencils.md
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.3.1 (current version) | 11 | 11/28/2026 |