mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
22 lines
707 B
PowerShell
22 lines
707 B
PowerShell
function Copy-ExcelWorkSheet {
|
|
[CmdletBinding()]
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
$SourceWorkbook,
|
|
[Parameter(Mandatory=$true)]
|
|
$SourceWorkSheet,
|
|
[Parameter(Mandatory=$true)]
|
|
$DestinationWorkbook,
|
|
$DestinationWorkSheet,
|
|
[Switch]$Show
|
|
)
|
|
|
|
Write-Verbose "Copying $($SourceWorkSheet) from $($SourceWorkbook) to $($DestinationWorkSheet) in $($DestinationWorkbook)"
|
|
|
|
if(!$DestinationWorkSheet) {
|
|
$DestinationWorkSheet = $SourceWorkSheet
|
|
}
|
|
|
|
Import-Excel -Path $SourceWorkbook -WorkSheetname $SourceWorkSheet |
|
|
Export-Excel -Path $DestinationWorkbook -WorkSheetname $DestinationWorkSheet -Show:$Show
|
|
} |