Linux dependencies missing warning

This commit is contained in:
ili101
2019-08-29 23:50:10 +03:00
parent 591b854e2b
commit bb9aa9233b

View File

@@ -60,6 +60,25 @@ else {
Write-Warning 'PowerShell 5 is required for plot.ps1' Write-Warning 'PowerShell 5 is required for plot.ps1'
Write-Warning 'PowerShell Excel is ready, except for that functionality' Write-Warning 'PowerShell Excel is ready, except for that functionality'
} }
if ($IsLinux -or $IsMacOS) {
$ExcelPackage = [OfficeOpenXml.ExcelPackage]::new()
$Cells = ($ExcelPackage | Add-WorkSheet).Cells['A1']
$Cells.Value = 'Test'
try {
$Cells.AutoFitColumns()
}
catch {
if ($IsLinux) {
Write-Warning -Message 'ImportExcel Module Cannot Autosize. Please run the following command to install dependencies: "sudo apt-get install -y --no-install-recommends libgdiplus libc6-dev"'
}
if ($IsMacOS) {
Write-Warning -Message 'ImportExcel Module Cannot Autosize. Please run the following command to install dependencies: "brew install mono-libgdiplus"'
}
}
finally {
$ExcelPackage | Close-ExcelPackage -NoSave
}
}
#endregion #endregion
function Import-Excel { function Import-Excel {
<# <#