Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

Commit 80897c0

Browse files
Fix for Get-WordDocument relative paths
1 parent ea4d495 commit 80897c0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

PSWriteWord.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Description = 'Simple project to create Microsoft Word in PowerShell without having Office installed.'
99
FunctionsToExport = @('Get-WordBookmark', 'Set-WordBookmark', 'New-WordBlock', 'New-WordBlockList', 'New-WordBlockPageBreak', 'New-WordBlockParagraph', 'New-WordBlockTable', 'Add-WordBarChart', 'Add-WordChartSeries', 'Add-WordLineChart', 'Add-WordPieChart', 'Documentimo', 'DocChart', 'DocList', 'DocListItem', 'DocNumbering', 'DocPageBreak', 'DocTable', 'DocText', 'DocToc', 'Add-WordFooter', 'Add-WordHeader', 'Get-WordFooter', 'Get-WordHeader', 'Add-WordHyperLink', 'Add-WordList', 'Add-WordListItem', 'Convert-ListToHeadings', 'New-WordList', 'New-WordListItem', 'New-WordListItemInternal', 'Set-WordList', 'Get-WordDocument', 'Merge-WordDocument', 'New-WordDocument', 'Save-WordDocument', 'Add-WordCustomProperty', 'Add-WordEquation', 'Add-WordLine', 'Add-WordPageCount', 'Add-WordProtection', 'Add-WordSection', 'Add-WordTabStopPosition', 'Get-WordCustomProperty', 'Get-WordPageSettings', 'Get-WordSection', 'Set-WordMargins', 'Set-WordOrientation', 'Set-WordPageSettings', 'Set-WordPageSize', 'Add-WordPageBreak', 'Add-WordParagraph', 'Add-WordText', 'Get-WordListItemParagraph', 'Get-WordParagraphs', 'Get-WordParagraphForList', 'Remove-WordParagraph', 'Remove-WordText', 'Set-WordParagraph', 'Set-WordText', 'Set-WordTextAlignment', 'Set-WordTextBold', 'Set-WordTextCapsStyle', 'Set-WordTextColor', 'Set-WordTextDirection', 'Set-WordTextFontFamily', 'Set-WordTextFontSize', 'Set-WordTextHeadingType', 'Set-WordTextHidden', 'Set-WordTextHighlight', 'Set-WordTextIndentationFirstLine', 'Set-WordTextIndentationHanging', 'Set-WordTextItalic', 'Set-WordTextKerning', 'Set-WordTextLanguage', 'Set-WordTextMisc', 'Set-WordTextPercentageScale', 'Set-WordTextPosition', 'Set-WordTextReplace', 'Set-WordTextScript', 'Set-WordTextShadingType', 'Set-WordTextSpacing', 'Set-WordTextSpacingAfter', 'Set-WordTextSpacingBefore', 'Set-WordTextStrikeThrough', 'Set-WordTextUnderlineColor', 'Set-WordTextUnderlineStyle', 'Add-WordPicture', 'Get-WordPicture', 'Remove-WordPicture', 'Set-WordPicture', 'Add-WordTable', 'Add-WordTableCellValue', 'Add-WordTableColumn', 'Add-WordTableRow', 'Add-WordTableTitle', 'Copy-WordTableRow', 'Get-WordTable', 'Get-WordTableRow', 'New-WordTable', 'New-WordTableBorder', 'Remove-WordTable', 'Remove-WordTableColumn', 'Remove-WordTableRow', 'Set-WordTable', 'Set-WordTableAutoFit', 'Set-WordTableBorder', 'Set-WordTableCell', 'Set-WordTableCellFillColor', 'Set-WordTableCellShadingColor', 'Set-WordTableColumnWidth', 'Set-WordTableColumnWidthByIndex', 'Set-WordTableDesign', 'Set-WordTableDirection', 'Set-WordTablePageBreak', 'Set-WordTableRowMergeCells', 'Add-WordTOC', 'Add-WordTocItem')
1010
GUID = '6314c78a-d011-4489-b462-91b05ec6a5c4'
11-
ModuleVersion = '1.1.10'
11+
ModuleVersion = '1.1.11'
1212
PowerShellVersion = '5.1'
1313
PrivateData = @{
1414
PSData = @{

Public/Main/Get-WordDocument.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
#using namespace Xceed.Words.NET
2-
#using namespace Xceed.Document.NET
3-
4-
function Get-WordDocument {
1+
function Get-WordDocument {
52
[CmdletBinding()]
63
param(
74
[parameter(ValueFromPipelineByPropertyName, ValueFromPipeline)][alias('Path')][string] $FilePath,
85
[string] $LicenseKey
96
)
107
if ($FilePath -ne '') {
8+
$FilePath = Convert-Path -LiteralPath $FilePath
9+
1110
if (Test-Path -LiteralPath $FilePath) {
1211
try {
1312
if ($LicenseKey) {

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ _PSWriteWord_ is PowerShell module to create Microsoft Word documents without Mi
2525

2626
## Updates
2727

28+
- 1.1.11 - 2021.05.16
29+
- 🐛 Fixed `Get-WordDocument` when working with relative paths [#53](https://github.com/EvotecIT/PSWriteWord/issues/53)
2830
- 1.1.10 - 2021.05.15
2931
- 🐛Replaced `Exit` with `Return` in `Get-WordDocument`, and few other cmdlets to prevent PowerShell Exit
3032
- 1.1.9 - 2020.09.21

0 commit comments

Comments
 (0)