Skip to content

Commit bf35ed4

Browse files
Merge remote-tracking branch 'origin/main' into main
2 parents 55e2eec + 65d937f commit bf35ed4

File tree

3 files changed

+94
-107
lines changed

3 files changed

+94
-107
lines changed

Modules/IntelliTect.MicrosoftWord/IntelliTect.MicrosoftWord.psd1

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -8,131 +8,131 @@
88

99
@{
1010

11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './IntelliTect.MicrosoftWord.psm1'
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = './IntelliTect.MicrosoftWord.psm1'
1313

14-
# Version number of this module.
15-
ModuleVersion = '0.5.0.8'
14+
# Version number of this module.
15+
ModuleVersion = '0.5.0.9'
1616

17-
# Supported PSEditions
18-
# CompatiblePSEditions = @()
17+
# Supported PSEditions
18+
# CompatiblePSEditions = @()
1919

20-
# ID used to uniquely identify this module
21-
GUID = '46f84048-02ed-4a12-8ec5-00be86a95abb'
20+
# ID used to uniquely identify this module
21+
GUID = '46f84048-02ed-4a12-8ec5-00be86a95abb'
2222

23-
# Author of this module
24-
Author = 'Mark Michaelis, Kelly Adams'
23+
# Author of this module
24+
Author = 'Mark Michaelis, Kelly Adams'
2525

26-
# Company or vendor of this module
27-
CompanyName = 'IntelliTect'
26+
# Company or vendor of this module
27+
CompanyName = 'IntelliTect'
2828

29-
# Copyright statement for this module
30-
Copyright = '(c) Mark Michaelis, Kelly Adams. All rights reserved.'
29+
# Copyright statement for this module
30+
Copyright = '(c) Mark Michaelis, Kelly Adams. All rights reserved.'
3131

32-
# Description of the functionality provided by this module
33-
Description = 'Provides an easy-to-use interface to Microsoft Word via PowerShell.'
32+
# Description of the functionality provided by this module
33+
Description = 'Provides an easy-to-use interface to Microsoft Word via PowerShell.'
3434

35-
# Minimum version of the PowerShell engine required by this module
36-
# PowerShellVersion = ''
35+
# Minimum version of the PowerShell engine required by this module
36+
# PowerShellVersion = ''
3737

38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
38+
# Name of the PowerShell host required by this module
39+
# PowerShellHostName = ''
4040

41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
41+
# Minimum version of the PowerShell host required by this module
42+
# PowerShellHostVersion = ''
4343

44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
# DotNetFrameworkVersion = ''
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
# DotNetFrameworkVersion = ''
4646

47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# ClrVersion = ''
4949

50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
5252

53-
# Modules that must be imported into the global environment prior to importing this module
54-
# RequiredModules = @()
53+
# Modules that must be imported into the global environment prior to importing this module
54+
# RequiredModules = @()
5555

56-
# Assemblies that must be loaded prior to importing this module
57-
# RequiredAssemblies = @()
56+
# Assemblies that must be loaded prior to importing this module
57+
# RequiredAssemblies = @()
5858

59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
ScriptsToProcess = './tools/install.ps1'
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
ScriptsToProcess = './tools/install.ps1'
6161

62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
6464

65-
# Format files (.ps1xml) to be loaded when importing this module
66-
# FormatsToProcess = @()
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
# FormatsToProcess = @()
6767

68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
# NestedModules = @()
7070

71-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72-
FunctionsToExport = 'Test-FileIsLocked', 'Open-MicrosoftWord', 'Open-WordDocument',
73-
'Get-WordDocumentComment', 'Update-WordDocumentAcceptAllChanges',
74-
'Set-WordDocumentTrackChanges', 'Get-WordDocumentTrackChanges',
75-
'Set-WordDocumentProtection', 'Invoke-WordDocumentFindReplace',
76-
'Invoke-WordDocumentFind', 'Compare-WordDocument',
77-
'Get-WordDocumentProperty', 'Set-WordDocumentProperty',
78-
'Get-WordDocumentTemplate', 'Set-WordDocumentTemplate'
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = 'Test-FileIsLocked', 'Open-MicrosoftWord', 'Open-WordDocument',
73+
'Get-WordDocumentComment', 'Update-WordDocumentAcceptAllChanges',
74+
'Set-WordDocumentTrackChanges', 'Get-WordDocumentTrackChanges',
75+
'Set-WordDocumentProtection', 'Invoke-WordDocumentFindReplace',
76+
'Invoke-WordDocumentFind', 'Compare-WordDocument',
77+
'Get-WordDocumentProperty', 'Set-WordDocumentProperty',
78+
'Get-WordDocumentTemplate', 'Set-WordDocumentTemplate'
7979

80-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
81-
CmdletsToExport = '*'
80+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
81+
CmdletsToExport = '*'
8282

83-
# Variables to export from this module
84-
VariablesToExport = '*'
83+
# Variables to export from this module
84+
VariablesToExport = '*'
8585

86-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
87-
AliasesToExport = '*'
86+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
87+
AliasesToExport = '*'
8888

89-
# DSC resources to export from this module
90-
# DscResourcesToExport = @()
89+
# DSC resources to export from this module
90+
# DscResourcesToExport = @()
9191

92-
# List of all modules packaged with this module
93-
# ModuleList = @()
92+
# List of all modules packaged with this module
93+
# ModuleList = @()
9494

95-
# List of all files packaged with this module
96-
# FileList = @()
95+
# List of all files packaged with this module
96+
# FileList = @()
9797

98-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
99-
PrivateData = @{
98+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
99+
PrivateData = @{
100100

101-
PSData = @{
101+
PSData = @{
102102

103-
# Tags applied to this module. These help with module discovery in online galleries.
104-
# Tags = @()
103+
# Tags applied to this module. These help with module discovery in online galleries.
104+
# Tags = @()
105105

106-
# A URL to the license for this module.
107-
# LicenseUri = ''
106+
# A URL to the license for this module.
107+
# LicenseUri = ''
108108

109-
# A URL to the main website for this project.
110-
# ProjectUri = ''
109+
# A URL to the main website for this project.
110+
# ProjectUri = ''
111111

112-
# A URL to an icon representing this module.
113-
# IconUri = ''
112+
# A URL to an icon representing this module.
113+
# IconUri = ''
114114

115-
# ReleaseNotes of this module
116-
# ReleaseNotes = ''
115+
# ReleaseNotes of this module
116+
# ReleaseNotes = ''
117117

118-
# Prerelease string of this module
119-
# Prerelease = ''
118+
# Prerelease string of this module
119+
# Prerelease = ''
120120

121-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
122-
# RequireLicenseAcceptance = $false
121+
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
122+
# RequireLicenseAcceptance = $false
123123

124-
# External dependent modules of this module
125-
# ExternalModuleDependencies = @()
124+
# External dependent modules of this module
125+
# ExternalModuleDependencies = @()
126126

127-
} # End of PSData hashtable
127+
} # End of PSData hashtable
128128

129-
} # End of PrivateData hashtable
129+
} # End of PrivateData hashtable
130130

131-
# HelpInfo URI of this module
132-
# HelpInfoURI = ''
131+
# HelpInfo URI of this module
132+
# HelpInfoURI = ''
133133

134-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
135-
# DefaultCommandPrefix = ''
134+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
135+
# DefaultCommandPrefix = ''
136136

137137
}
138138

Modules/IntelliTect.MicrosoftWord/IntelliTect.MicrosoftWord.psm1

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
try {
2-
add-type -AssemblyName 'Microsoft.Office.Interop.Word'
2+
$wordAssemblyPath = "./Lib/WordInteropNugetPackage/lib/netstandard2.0/Microsoft.Office.Interop.Word.dll"
3+
add-type -Path $wordAssemblyPath
34
}
45
catch {
5-
try {
6-
# the install location of the dll as per install.ps1
7-
$wordAssemblyPath = Resolve-Path "./Lib/WordInteropNugetPackage/lib/netstandard2.0/Microsoft.Office.Interop.Word.dll" | `
8-
Sort-Object -Descending | Select-Object -First 1
9-
if ($wordAssemblyPath -and (Test-Path $wordAssemblyPath)) {
10-
add-type -Path $wordAssemblyPath
11-
}
12-
else {
13-
throw;
14-
}
15-
}
16-
catch {
176
throw 'Unable to find Microsoft.Office.Interop.Word package (see https://www.nuget.org/packages/Microsoft.Office.Interop.Word)'
18-
}
197
}
208

9+
2110
#TODO: Remove and use dependency on File.ps1 (module needed) instead.
2211
Function Test-FileIsLocked {
2312
[CmdletBinding()]

Modules/IntelliTect.MicrosoftWord/tools/install.ps1

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

2+
# this file despite running from the ./tools folder has a working dir of the root of the module
23
# get the latest word interop package and place the dll in the lib folder
34
$wordInteropNugetDownloadUrl = "https://www.nuget.org/api/v2/package/Microsoft.Office.Interop.Word"
45

5-
$ZipFile = "./" + $(Split-Path -Path $wordInteropNugetDownloadUrl -Leaf) + ".zip"
6+
$ZipFile = "./Lib/" + $(Split-Path -Path $wordInteropNugetDownloadUrl -Leaf) + ".zip"
67

7-
$ExtractPath = "../Lib/WordInteropNugetPackage"
8+
$ExtractPath = "./Lib/WordInteropNugetPackage"
89

910
Invoke-WebRequest -Uri $wordInteropNugetDownloadUrl -OutFile $ZipFile
1011

@@ -16,13 +17,11 @@ Remove-Item $ZipFile
1617

1718
try {
1819
add-type -AssemblyName 'Microsoft.Office.Interop.Word'
19-
Write-Output "Microsoft.Office.Interop.Word installed for module."
2020
}
2121
catch {
2222
try {
2323
# the install location of the dll as per install.ps1
24-
$wordAssemblyPath = Resolve-Path "../Lib/WordInteropNugetPackage/lib/netstandard2.0/Microsoft.Office.Interop.Word.dll" | `
25-
Sort-Object -Descending | Select-Object -First 1
24+
$wordAssemblyPath = "./Lib/WordInteropNugetPackage/lib/netstandard2.0/Microsoft.Office.Interop.Word.dll"
2625
if ($wordAssemblyPath -and (Test-Path $wordAssemblyPath)) {
2726
add-type -Path $wordAssemblyPath
2827
Write-Output "Microsoft.Office.Interop.Word installed for module."
@@ -36,13 +35,12 @@ catch {
3635
}
3736
}
3837

39-
40-
4138
try {
4239
# check if word is installed
40+
Write-Output "Checking for Microsoft Word installation. (Module requires existing Word Installation)"
4341
$Word = New-Object -ComObject word.application
4442
$Word.Quit([Microsoft.Office.Interop.Word.WdSaveOptions]::wdDoNotSaveChanges)
45-
Write-Output "Microsoft Word is installed. (Module requires existing Word Installation)"
43+
Write-Output "Microsoft Word is installed. "
4644
}
4745
catch {
4846
throw 'Unable to find Microsoft Word. You must have an install of Microsoft Word in order to use this module.'

0 commit comments

Comments
 (0)