mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-27 13:43:36 +00:00
Move help from Comment-based to md. Relocate functions (sans help)
This commit is contained in:
27
ExportedCommands/Export-MultipleExcelSheets.ps1
Normal file
27
ExportedCommands/Export-MultipleExcelSheets.ps1
Normal file
@@ -0,0 +1,27 @@
|
||||
function Export-MultipleExcelSheets {
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "")]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
$Path,
|
||||
[Parameter(Mandatory = $true)]
|
||||
[hashtable]$InfoMap,
|
||||
[string]$Password,
|
||||
[Switch]$Show,
|
||||
[Switch]$AutoSize
|
||||
)
|
||||
|
||||
$parameters = @{ } + $PSBoundParameters
|
||||
$parameters.Remove("InfoMap")
|
||||
$parameters.Remove("Show")
|
||||
|
||||
$parameters.Path = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Path)
|
||||
|
||||
foreach ($entry in $InfoMap.GetEnumerator()) {
|
||||
Write-Progress -Activity "Exporting" -Status "$($entry.Key)"
|
||||
$parameters.WorkSheetname = $entry.Key
|
||||
|
||||
& $entry.Value | Export-Excel @parameters
|
||||
}
|
||||
|
||||
if ($Show) { Invoke-Item $Path }
|
||||
}
|
||||
Reference in New Issue
Block a user