Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
/ PSWriteExcel Public archive

PSWriteExcel is very basic (at the moment) PowerShell module to create Microsoft Excel workbooks without Microsoft Excel installed.

Notifications You must be signed in to change notification settings

EvotecIT/PSWriteExcel

Repository files navigation

PSWriteExcel - PowerShell Module

New version of this module will be developed under PSWriteOffice project. This module will no longer be developed! It has been replaced by PSWriteOffice project which will be a combination of Word, Excel and in future PowerPoint features. No new features, fixes will be added, but it will continue to work.


What is PSWriteExcel?

PSWriteExcel is very basic (at the moment) PowerShell module to create Microsoft Excel workbooks without Microsoft Excel installed. Its main purpose is to support/create Excel for PSWinDocumentation project. Depending on requirements of this project (and maybe few others) it may evolve or cover more feature sets. After some basic testing, it seems to work fine on Windows and Linux and MacOS.

More information can be found on a dedicated page for PSWriteExcel module.

There are 2 ways to use this module

  • Long way - New-ExcelDocument, Add-ExcelWorkSheet, Add-ExcelWorksheetData and finally Save-ExcelDocument
  • Short way - $Object | ConvertTo-Excel -Path 'Export.xlsx' -WorkSheetName 'MyName'

There are couple of more commands in play that may come useful. Feel free to explore.

Example usage of Add-ExcelWorksheetData in action

image

Changelog

  • 0.1.14 - 2022.15.16

    • Fixes bad release
  • 0.1.13 - 2022.15.16

    • Fixes an issue when column names are duplicates #5
  • 0.1.12 - 2020.11.21

    • Added back missing cmdlet which would prevent Excel cmdlet from working
  • 0.1.11 - 2020.09.24

    • Set-ExcelWorkSheetCellStyle is now usable, it wasn't even half working before.
  • 0.1.10 - 2020.07.31

    • Fix misspelling of "suppress" as "supress" (finally!) - tnx natescherer #7
  • 0.1.9 - 2020.07.30

    • Added verification for cell lenght to prevent errors. Cell will be trimmed to 32767 chars when lenght exceeds that.
  • 0.1.8 - 2020.06.21

    • Small improvement
  • 0.1.7 - 2020.06.21

    • Fix for not displaying $False and few other values
  • 0.1.6 - 2020.06.10

    • Fix for colors, Colors should limit output while typing
    • Added Request-ExcelWorkSheetCalculation
    • Added ability to add CellFormula to Add-ExcelWorkSheetCell
    • Fix for Transpose in ConvertTo-Excel
  • 0.1.5 - 2020.01.17

    • Merged Excelimo back into PSWriteExcel
    • Merged all dependencies into PSWriteExcel - requires additional modules only for development like all my other modules
  • 0.1.2 - 23.06.2019

    • Support for PSSharedGoods 0.0.79
    • Some speed improvements
  • 0.1.0 - 17.04.2019

    • Big Performance improvements, removed some redundant calls
    • Updated .DLL to the newest version (compiled from Source Code on day 15.04.2019 with all changes/fixes in EPPlus)
  • 0.0.17 - 22.03.2019

    • Added -PreScanHeaders to ConvertTo-Excel - objects are prescanned first so that property names are known before exporting
  • 0.0.16 - 15.02.2019

    • Added -TableStyle ConvertTo-Excel
    • Added -TableStyle Add-ExcelWorksheetData

Installing PowerShell Core on (Linux - Ubuntu)

# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of products
sudo apt-get update
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh

For anything else refer to the great Microsoft Article - Installing PowerShell Core on Linux

Installing on Windows / Linux / MacOS

Install-Module PSWriteExcel -Scope CurrentUser
#Update-Module PSWriteExcel

Using on Linux

Get-Process | ConvertTo-Excel -Path 'ThisIsMyExcel.xlsx' -WorkSheetName 'AndWorksheet' -AutoFilter

image

Credits

This module is based on EPPlus and it's doing all the magic behind this project. PSWriteExcel is merely a wrapper around that with few PowerShell tricks around converting objects into tables.

About

PSWriteExcel is very basic (at the moment) PowerShell module to create Microsoft Excel workbooks without Microsoft Excel installed.

Topics

Resources

Stars

Watchers

Forks