mirror of
https://github.com/dfinke/ImportExcel.git
synced 2026-02-08 20:50:30 +00:00
19 lines
409 B
PowerShell
19 lines
409 B
PowerShell
Function Remove-WorkSheet {
|
|
param(
|
|
[Parameter(Mandatory)]
|
|
$Path,
|
|
[Parameter(Mandatory)]
|
|
[String[]]$WorksheetName,
|
|
[Switch]$Show
|
|
)
|
|
|
|
$pkg = Open-ExcelPackage -Path $Path
|
|
|
|
if ($pkg) {
|
|
foreach ($wsn in $WorksheetName) {
|
|
$pkg.Workbook.Worksheets.Delete($wsn)
|
|
}
|
|
|
|
Close-ExcelPackage -ExcelPackage $pkg -Show:$Show
|
|
}
|
|
} |