PrateekKumarSingh / AzViz

⚡ ☁ Azure Visualizer aka 'AzViz' : A #powershell module to automatically generate Azure resource topology diagrams by just typing a PowerShell cmdlet and passing the name of one or more Azure Resource groups
MIT License
602 stars 151 forks source link

Add flexibility finding the `dot` binary #66

Closed brettwhiteinc closed 2 years ago

brettwhiteinc commented 3 years ago

Get-DotExecutable.ps1: This function has a few hardcoded paths to dot. On macOS some package mangers install to a different location in order to avoid overwriting system binaries. The package manager directory is in $env:PATH. By adding a call Get-Command in this function we can search for dot in the system's PATH and have a higher success of finding it.

Export-AzViz.ps1: Similarly it seems like the PSGraph module use a few hardcoded paths, too. Fortunately they include a -GraphVizPath parameter that allows us to specify the path. Since we already got the path for error checking earlier in in this module we can simply reuse that in the call to Export-PsGraph.