mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Updated msg for Autosize on Linux
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
#region import everything we need
|
#region import everything we need
|
||||||
$culture= $host.CurrentCulture.Name -replace '-\w*$',''
|
$culture = $host.CurrentCulture.Name -replace '-\w*$', ''
|
||||||
Import-LocalizedData -UICulture $culture -BindingVariable Strings -FileName Strings -ErrorAction Ignore
|
Import-LocalizedData -UICulture $culture -BindingVariable Strings -FileName Strings -ErrorAction Ignore
|
||||||
if (-not $Strings) {
|
if (-not $Strings) {
|
||||||
Import-LocalizedData -UICulture "en" -BindingVariable Strings -FileName Strings -ErrorAction Ignore
|
Import-LocalizedData -UICulture "en" -BindingVariable Strings -FileName Strings -ErrorAction Ignore
|
||||||
}
|
}
|
||||||
try {[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")}
|
try { [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") }
|
||||||
catch {Write-Warning -Message $Strings.SystemDrawingAvaialable}
|
catch { Write-Warning -Message $Strings.SystemDrawingAvaialable }
|
||||||
|
|
||||||
foreach ($directory in @('Public','Charting','InferData','Pivot')) {
|
foreach ($directory in @('Public', 'Charting', 'InferData', 'Pivot')) {
|
||||||
Get-ChildItem -Path "$PSScriptRoot\$directory\*.ps1" | ForEach-Object {. $_.FullName}
|
Get-ChildItem -Path "$PSScriptRoot\$directory\*.ps1" | ForEach-Object { . $_.FullName }
|
||||||
}
|
}
|
||||||
|
|
||||||
. $PSScriptRoot\ArgumentCompletion.ps1
|
. $PSScriptRoot\ArgumentCompletion.ps1
|
||||||
@@ -42,15 +42,20 @@ if (($IsLinux -or $IsMacOS) -or $env:NoAutoSize) {
|
|||||||
catch {
|
catch {
|
||||||
$env:NoAutoSize = $true
|
$env:NoAutoSize = $true
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
Write-Warning -Message ('ImportExcel Module Cannot Autosize. Please run the following command to install dependencies:' + [environment]::newline +
|
$msg = @"
|
||||||
'"sudo apt-get install -y --no-install-recommends libgdiplus libc6-dev"')
|
ImportExcel Module Cannot Autosize. Please run the following command to install dependencies:
|
||||||
|
apt-get -y update && apt-get install -y --no-install-recommends libgdiplus libc6-dev
|
||||||
|
"@
|
||||||
|
Write-Warning -Message $msg
|
||||||
}
|
}
|
||||||
if ($IsMacOS) {
|
if ($IsMacOS) {
|
||||||
Write-Warning -Message ('ImportExcel Module Cannot Autosize. Please run the following command to install dependencies:' + [environment]::newline +
|
$msg = @"
|
||||||
'"brew install mono-libgdiplus"')
|
ImportExcel Module Cannot Autosize. Please run the following command to install dependencies:
|
||||||
|
brew install mono-libgdiplus
|
||||||
|
"@
|
||||||
|
Write-Warning -Message $msg
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
$ExcelPackage | Close-ExcelPackage -NoSave
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
|
||||||
$ExcelPackage | Close-ExcelPackage -NoSave
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user