Skip to content

Commit

Permalink
Merge pull request #91 from quintindk/fix/wsl-diagram
Browse files Browse the repository at this point in the history
Fix: compatibility with WSL and Powershell Unix for draw.io diagram
  • Loading branch information
Claudio-Merola authored Dec 8, 2022
2 parents a129693 + 93f5545 commit a5316c7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions AzureResourceInventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,15 @@ param ($TenantID,
$ModuSeq = (New-Object System.Net.WebClient).DownloadString($($args[7]) + '/Extras/DrawIODiagram.ps1')
}
Else {
$ModuSeq0 = New-Object System.IO.StreamReader($($args[0]) + '\Extras\DrawIODiagram.ps1')
if($($args[0]) -like '*\*')
{
$ModuSeq0 = New-Object System.IO.StreamReader($($args[0]) + '\Extras\DrawIODiagram.ps1')
}
else
{
$ModuSeq0 = New-Object System.IO.StreamReader($($args[0]) + '/Extras/DrawIODiagram.ps1')
}
$ModuSeq0 = New-Object System.IO.StreamReader($($args[0]) + '/Extras/DrawIODiagram.ps1')
$ModuSeq = $ModuSeq0.ReadToEnd()
$ModuSeq0.Dispose()
}
Expand Down Expand Up @@ -1416,7 +1424,7 @@ Write-Host ('Excel file saved at: ') -NoNewline
write-host $File -ForegroundColor Cyan
Write-Host ''

if($Global:PlatOS -eq 'PowerShell Desktop' -and $Diagram.IsPresent) {
if(($Global:PlatOS -eq 'PowerShell Desktop' -or $Global:PlatOS -eq 'PowerShell Unix') -and $Diagram.IsPresent) {
Write-Host ('Draw.io Diagram file saved at: ') -NoNewline
write-host $DDFile -ForegroundColor Cyan
Write-Host ''
Expand All @@ -1428,4 +1436,4 @@ if ($Diagram.IsPresent -and $Global:VisioCheck) {
write-host $DFile -ForegroundColor Cyan
Write-Host ''
}
#>
#>

0 comments on commit a5316c7

Please sign in to comment.