mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Added Copy-ExcelWorksheet
This commit is contained in:
22
Copy-ExcelWorkSheet.ps1
Normal file
22
Copy-ExcelWorkSheet.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
@@ -21,6 +21,7 @@ $fileList = echo `
|
||||
Get-ExcelSheetInfo.ps1 `
|
||||
Get-Range.ps1 `
|
||||
TrackingUtils.ps1 `
|
||||
Copy-ExcelWorkSheet.ps1 `
|
||||
plot.ps1
|
||||
|
||||
if ('' -eq $InstallDirectory)
|
||||
|
||||
@@ -25,9 +25,10 @@ $targetFiles = echo `
|
||||
Import-Html.ps1 `
|
||||
Get-Range.ps1 `
|
||||
TrackingUtils.ps1 `
|
||||
Copy-ExcelWorkSheet.ps1 `
|
||||
plot.ps1
|
||||
|
||||
ls $targetFiles |
|
||||
|
||||
ls $targetFiles |
|
||||
ForEach {
|
||||
Copy-Item -Verbose -Path $_.FullName -Destination "$($TargetPath)\$($_.name)"
|
||||
}
|
||||
Reference in New Issue
Block a user