mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Linux dependencies missing warning
This commit is contained in:
@@ -60,6 +60,25 @@ else {
|
||||
Write-Warning 'PowerShell 5 is required for plot.ps1'
|
||||
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
|
||||
function Import-Excel {
|
||||
<#
|
||||
|
||||
Reference in New Issue
Block a user