Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: compatibility with WSL and Powershell Unix for draw.io diagram #91

Merged
merged 4 commits into from
Dec 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions AzureResourceInventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,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 @@ -1417,7 +1425,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 @@ -1429,4 +1437,4 @@ if ($Diagram.IsPresent -and $Global:VisioCheck) {
write-host $DFile -ForegroundColor Cyan
Write-Host ''
}
#>
#>