added
This commit is contained in:
commit
2bcc107c13
39 files changed
+2643
No files matched your search
@@ -0,0 +1,11 @@
|
||||
[CmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[Parameter(Mandatory)][string]$Source,
|
||||
[Parameter(Mandatory)][string]$Destination
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
if (-not (Test-Path -LiteralPath $Source -PathType Leaf)) { throw 'Source workbook is missing.' }
|
||||
if (Test-Path -LiteralPath $Destination) { throw 'Destination exists; choose a new file path.' }
|
||||
if ($PSCmdlet.ShouldProcess($Destination, 'Copy workbook')) {
|
||||
[IO.File]::Copy([IO.Path]::GetFullPath($Source), [IO.Path]::GetFullPath($Destination), $false)
|
||||
}
|
||||
Reference in new issue
Block a user