EvotecIT / PSWriteExcel

PSWriteExcel is very basic (at the moment) PowerShell module to create Microsoft Excel workbooks without Microsoft Excel installed.
61 stars 12 forks source link
excel powershell

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

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

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.