-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.md.ps1
More file actions
136 lines (85 loc) · 2.8 KB
/
README.md.ps1
File metadata and controls
136 lines (85 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
$ThisModule = Import-Module ./ -PassThru
$intro = @'
OpenXML is the standard used for Office documents.
You can think of it as a .zip in a trenchcoat.
Every part of an Excel, PowerPoint, or Word document is saved into an archive.
You can prove this to yourself by renaming any .docx file to .zip.
I sometimes call this the "zip epiphany", because it helps you understand how much technology is really a "zip in a trenchcoat".
(hint: it's _much_ more than just OpenXML files)
This module is here to help you automate, inspect, and understand OpenXML files.
'@
"# $($ThisModule.Name)"
"## $($ThisModule.Description)"
@"
<div align='center'>
<a href='https://www.powershellgallery.com/packages/OpenXML/' >
<img src='https://img.shields.io/powershellgallery/dt/OpenXML' />
</a>
</div>
"@
$intro
"### Installing and Importing"
@"
You can install $($ThisModule.Name) from the PowerShell gallery
~~~PowerShell
Install-Module $($ThisModule.Name) -Scope CurrentUser -Force
~~~
Once installed, you can simply ``Import-Module``
~~~PowerShell
Import-Module $($ThisModule.Name)
~~~
"@
"### Commands"
$thisModulesFunctions = $ThisModule.ExportedFunctions.Keys | Sort-Object Name
foreach ($command in $thisModulesFunctions) {
"* $($command)"
}
"### Demos"
$quickDemos = {
# Get text from a word document
Get-OpenXML ./Examples/HelloWorld.docx |
Select-Object -ExpandProperty Text
}, {
# Get modification times
Get-OpenXML ./Examples/HelloWorld.docx |
Select-Object -Property Created, Modified
}, {
# Get PowerPoint slides
Get-OpenXML ./Examples/ASlideDeck.pptx |
Select-Object -ExpandProperty Slides
},{
# Get text from PowerPoint
Get-OpenXML ./Examples/ASlideDeck.pptx |
Select-Object -ExpandProperty Text
}, {
# Get worksheets from Excel
Get-OpenXML ./Examples/Sample.xlsx |
Select-Object -ExpandProperty Worksheets
},{
# Get cells from Excel
Get-OpenXML ./Examples/Sample.xlsx |
Select-Object -ExpandProperty Worksheets |
Select-Object -ExpandProperty Cell
},{
# Get formulas from Excel
Get-OpenXML ./Examples/Sum.xlsx |
Select-Object -ExpandProperty Worksheets |
Select-Object -ExpandProperty Formula
}
foreach ($demo in $quickDemos) {
"~~~PowerShell"
"$demo"
"~~~"
}
"### Roadmap"
$roadmap = @'
While OpenXML has been around since 2006, this module is considerably younger.
It has a large amount of room to grow.
The primary goal for the forseeable future is to increase coverage of office features. If you would like to help, please consider [contributing](CONTRIBUTING.md).
'@
$roadmap
"### Security"
@'
OpenXML presents some unique security challenges.
This module makes OpenXML documents easier to read and write, which can be useful to both red and blue teams. Please see the [security guide](SECURITY.md) for more information.
'@