Skip to content

Commit 2319f8d

Browse files
feat: Export-OpenXML ( Fixes #15 )
1 parent db172a3 commit 2319f8d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Commands/Export-OpenXML.ps1

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
function Export-OpenXML {
2+
<#
3+
.SYNOPSIS
4+
Exports OpenXML
5+
.DESCRIPTION
6+
Exports loaded OpenXML to a file.
7+
#>
8+
[Alias('Save-OpenXML')]
9+
param(
10+
# The file path to save the turtle graphics pattern.
11+
[Parameter(Mandatory,ValueFromPipelineByPropertyName)]
12+
[Alias('Path')]
13+
[string]
14+
$FilePath,
15+
16+
# The input object.
17+
# This must be a package loaded with this module.
18+
[Parameter(ValueFromPipeline)]
19+
[PSObject]
20+
$InputObject,
21+
22+
# If set, will force the export even if a file already exists.
23+
[switch]
24+
$Force
25+
)
26+
27+
process {
28+
# If there is no input return
29+
if (-not $InputObject) { return }
30+
# If the input is not a package, pass it thru
31+
if ($InputObject -isnot [IO.Packaging.Package]) {
32+
return $InputObject
33+
}
34+
35+
Copy-OpenXML -DestinationPath $FilePath -InputObject $inputObject -force:$Force
36+
}
37+
}
38+

0 commit comments

Comments
 (0)