Skip to content

Commit 1938d3c

Browse files
chore: 🔧 Update CHANGELOG for version 0.3.0 and add new examples
* Bump version to `0.3.0` with breaking changes. * Remove legacy dependencies and cmdlet surface. * Add new examples for PowerPoint and Excel functionalities. * Enhance README and TODO with updated project vision and goals.
1 parent 1949d41 commit 1938d3c

15 files changed

+206
-67
lines changed

CHANGELOG.MD

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
#### 0.2.0 - 2024.02.21
1+
#### 0.3.0 - 2025.12.29
2+
- Rebooted on OfficeIMO.* (Word/Excel/PowerPoint/Markdown/CSV/Word.Html) with breaking changes.
3+
- Removed legacy external dependencies and old cmdlet surface.
4+
- Added rebooted DSL examples and tests.
5+
6+
#### 0.2.0 - 2024.02.21
27
- Updated `OfficeIMO.Word` to `0.13.0`
3-
- Updated `ClosedXML` to `0.102.2`
48

59
#### 0.1.0 - 2023.06.23
610
- Updated `OfficeIMO.Word` to **0.5.0** which has many improvements and new features
@@ -14,9 +18,7 @@
1418
- Fixes `Close-OfficeWord` to properly dipose of document
1519

1620
#### 0.0.4 - 2022.08.14
17-
- Added `Import-OfficeExcel` to import Excel files as PowerShell objects
1821
- Library `OfficeIMO.Word` updated to **0.2.1** which has many improvements around Tables and basic Charts support
19-
- Library `ClosedXML` updated to **0.96.0**
2022

2123
#### 0.0.3 - 2022.06.05
2224
- Library `OfficeIMO.Word` updated to **0.1.5** which fixes
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Import-Module (Join-Path $PSScriptRoot '..\..\PSWriteOffice.psd1') -Force
2+
3+
$documents = Join-Path $PSScriptRoot '..\Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'Csv-Advanced.csv'
7+
$rows = @(
8+
[PSCustomObject]@{ Name = 'Alpha'; Score = 92; Active = $true }
9+
[PSCustomObject]@{ Name = 'Beta'; Score = 76; Active = $true }
10+
[PSCustomObject]@{ Name = 'Gamma'; Score = 64; Active = $false }
11+
)
12+
13+
$rows | ConvertTo-OfficeCsv -OutputPath $path -Delimiter ';' | Out-Null
14+
15+
Write-Host "CSV saved to $path"
16+
Get-OfficeCsvData -Path $path -Delimiter ';' -AsHashtable | Format-Table
Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1-
Clear-Host
2-
#Import-Module .\PSWriteOffice.psd1 -Force
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
32

4-
$Presentation = New-OfficePowerPoint -FilePath "$PSScriptRoot\Documents\ExamplePowerPoint1.pptx"
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
55

6-
Add-OfficePowerPointSlide -Presentation $Presentation -Layout 1
6+
$path = Join-Path $documents 'ExamplePowerPoint1.pptx'
7+
$presentation = New-OfficePowerPoint -FilePath $path
78

8-
Write-Host $Presentation.Slides.Count -ForegroundColor Green
9+
$slide1 = Add-OfficePowerPointSlide -Presentation $presentation -Layout 1
10+
Set-OfficePowerPointSlideTitle -Slide $slide1 -Title 'Status Update' | Out-Null
11+
Add-OfficePowerPointTextBox -Slide $slide1 -Text 'Generated with PSWriteOffice' -X 80 -Y 150 -Width 320 -Height 40 | Out-Null
12+
Add-OfficePowerPointShape -Slide $slide1 -ShapeType Rectangle -X 80 -Y 210 -Width 320 -Height 120 -FillColor '#DDEEFF' -OutlineColor '#4472C4' -OutlineWidth 1 | Out-Null
913

10-
# Get the shapes collection from the first slide
11-
$shapes = $Presentation.Slides[0].Shapes
14+
$slide2 = Add-OfficePowerPointSlide -Presentation $presentation -Layout 1
15+
Set-OfficePowerPointSlideTitle -Slide $slide2 -Title 'Next Steps' | Out-Null
16+
Add-OfficePowerPointTextBox -Slide $slide2 -Text '1. Review numbers 2. Plan Q1 3. Ship' -X 80 -Y 150 -Width 360 -Height 80 | Out-Null
1217

13-
# Add a new rectangle shape
14-
$shapes.AddRectangle(50, 60, 100, 70)
15-
16-
$shapes.Item(0).TextBox.Text = "Hello World!"
17-
18-
$Presentation.Slides[1].Shapes | Format-Table
19-
20-
$Presentation.Slides[1].Shapes[0].TextBox.Text = "This is my title"
21-
22-
Save-OfficePowerPoint -Presentation $Presentation -Show
18+
Save-OfficePowerPoint -Presentation $presentation
19+
Write-Host "Presentation saved to $path"
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
Clear-Host
2-
# Simple example creating and saving a presentation
3-
$presentation = New-OfficePowerPoint -FilePath "$PSScriptRoot\Documents\BasicExample.pptx"
4-
Save-OfficePowerPoint -Presentation $presentation -Show
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
2+
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'BasicExample.pptx'
7+
$presentation = New-OfficePowerPoint -FilePath $path
8+
9+
Add-OfficePowerPointSlide -Presentation $presentation -Layout 1 | Out-Null
10+
Save-OfficePowerPoint -Presentation $presentation
11+
12+
Write-Host "Presentation saved to $path"
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
Clear-Host
2-
# Import-Module .\PSWriteOffice.psd1 -Force
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
32

4-
$presentation = New-OfficePowerPoint -FilePath "$PSScriptRoot\Documents\ExamplePowerPoint4.pptx"
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'ExamplePowerPoint4.pptx'
7+
$presentation = New-OfficePowerPoint -FilePath $path
58

69
$slide = Add-OfficePowerPointSlide -Presentation $presentation -Layout 1
7-
Set-OfficePowerPointSlideTitle -Slide $slide -Title 'Quarterly Report'
8-
Add-OfficePowerPointTextBox -Slide $slide -Text 'Generated with PSWriteOffice'
10+
Set-OfficePowerPointSlideTitle -Slide $slide -Title 'Quarterly Report' | Out-Null
11+
Add-OfficePowerPointTextBox -Slide $slide -Text 'Generated with PSWriteOffice' -X 90 -Y 160 -Width 320 -Height 50 | Out-Null
912

10-
Save-OfficePowerPoint -Presentation $presentation -Show
13+
Save-OfficePowerPoint -Presentation $presentation
14+
Write-Host "Presentation saved to $path"
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
Clear-Host
2-
# Create and load a PowerPoint presentation
3-
$path = "$PSScriptRoot\Documents\LoadExample.pptx"
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
2+
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'LoadExample.pptx'
47
$presentation = New-OfficePowerPoint -FilePath $path
8+
Add-OfficePowerPointSlide -Presentation $presentation -Layout 1 | Out-Null
59
Save-OfficePowerPoint -Presentation $presentation
10+
611
$loaded = Get-OfficePowerPoint -FilePath $path
7-
$loaded
12+
Write-Host "Loaded presentation with $($loaded.Slides.Count) slide(s)."
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
Clear-Host
2-
# Import-Module .\\PSWriteOffice.psd1 -Force
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
32

4-
$presentation = New-OfficePowerPoint -FilePath "$PSScriptRoot\Documents\ExamplePowerPoint6.pptx"
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'ExamplePowerPoint6.pptx'
7+
$presentation = New-OfficePowerPoint -FilePath $path
58
Add-OfficePowerPointSlide -Presentation $presentation -Layout 1 | Out-Null
69
Add-OfficePowerPointSlide -Presentation $presentation -Layout 1 | Out-Null
10+
711
Remove-OfficePowerPointSlide -Presentation $presentation -Index 0
8-
Save-OfficePowerPoint -Presentation $presentation -Show
12+
Save-OfficePowerPoint -Presentation $presentation
13+
14+
Write-Host "Presentation saved to $path"
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
Clear-Host
2-
# Demonstrates using WhatIf when saving a presentation
3-
$path = "$PSScriptRoot\Documents\WhatIfExample.pptx"
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
2+
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'WhatIfExample.pptx'
47
$presentation = New-OfficePowerPoint -FilePath $path
58
Add-OfficePowerPointSlide -Presentation $presentation -Layout 1 | Out-Null
9+
610
Save-OfficePowerPoint -Presentation $presentation -WhatIf
11+
Write-Host "WhatIf completed for $path"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Import-Module (Join-Path $PSScriptRoot '..\PSWriteOffice.psd1') -Force
2+
3+
$documents = Join-Path $PSScriptRoot 'Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$path = Join-Path $documents 'ExamplePowerPoint8-TablesAndShapes.pptx'
7+
$presentation = New-OfficePowerPoint -FilePath $path
8+
9+
$slide = Add-OfficePowerPointSlide -Presentation $presentation -Layout 1
10+
Set-OfficePowerPointSlideTitle -Slide $slide -Title 'Tables & Shapes' | Out-Null
11+
12+
$data = @(
13+
[PSCustomObject]@{ Product = 'Alpha'; Qty = 12; Revenue = 1200 }
14+
[PSCustomObject]@{ Product = 'Beta'; Qty = 7; Revenue = 940 }
15+
[PSCustomObject]@{ Product = 'Gamma'; Qty = 20; Revenue = 1840 }
16+
)
17+
18+
Add-OfficePowerPointTable -Slide $slide -Data $data -X 60 -Y 140 -Width 420 -Height 200 | Out-Null
19+
Add-OfficePowerPointShape -Slide $slide -ShapeType Ellipse -X 520 -Y 140 -Width 140 -Height 140 -FillColor '#FFE699' -OutlineColor '#C65911' -OutlineWidth 1 | Out-Null
20+
Add-OfficePowerPointTextBox -Slide $slide -Text 'Highlights' -X 530 -Y 300 -Width 120 -Height 40 | Out-Null
21+
22+
Save-OfficePowerPoint -Presentation $presentation
23+
Write-Host "Presentation saved to $path"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Import-Module (Join-Path $PSScriptRoot '..\..\PSWriteOffice.psd1') -Force
2+
3+
$documents = Join-Path $PSScriptRoot '..\Documents'
4+
New-Item -Path $documents -ItemType Directory -Force | Out-Null
5+
6+
$data = @(
7+
[PSCustomObject]@{ Region = 'North America'; Revenue = 125000; Owner = 'Ada' }
8+
[PSCustomObject]@{ Region = 'EMEA'; Revenue = 98000; Owner = 'Linus' }
9+
[PSCustomObject]@{ Region = 'APAC'; Revenue = 143000; Owner = 'Grace' }
10+
)
11+
12+
$path = Join-Path $documents 'Excel-TablesAndRanges.xlsx'
13+
New-OfficeExcel -Path $path {
14+
ExcelSheet 'Summary' {
15+
Set-OfficeExcelRow -Row 1 -Values 'Region', 'Revenue', 'Owner'
16+
Add-OfficeExcelTable -Data $data -TableName 'Sales' -TableStyle 'TableStyleMedium9' -AutoFit
17+
Set-OfficeExcelNamedRange -Name 'Revenue' -Range 'B2:B4'
18+
}
19+
ExcelSheet 'Notes' {
20+
ExcelCell -Address 'A1' -Value 'Generated by PSWriteOffice'
21+
}
22+
} | Out-Null
23+
24+
Write-Host "Workbook saved to $path"
25+
Write-Host 'Tables:'
26+
Get-OfficeExcelTable -Path $path | Format-Table

0 commit comments

Comments
 (0)