{"id":16480909,"url":"https://github.com/ramblingcookiemonster/psexcel","last_synced_at":"2025-04-09T08:09:11.545Z","repository":{"id":29508217,"uuid":"33046408","full_name":"RamblingCookieMonster/PSExcel","owner":"RamblingCookieMonster","description":"A simple Excel PowerShell module","archived":false,"fork":false,"pushed_at":"2021-08-31T10:47:48.000Z","size":1170,"stargazers_count":248,"open_issues_count":42,"forks_count":65,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-04-02T05:08:35.983Z","etag":null,"topics":["epplus","excel","powershell","powershell-modules","reporting","spreadsheet"],"latest_commit_sha":null,"homepage":"http://ramblingcookiemonster.github.io/PSExcel-Intro/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RamblingCookieMonster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-28T19:05:17.000Z","updated_at":"2025-03-10T22:20:54.000Z","dependencies_parsed_at":"2022-09-04T11:00:31.685Z","dependency_job_id":null,"html_url":"https://github.com/RamblingCookieMonster/PSExcel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamblingCookieMonster%2FPSExcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamblingCookieMonster%2FPSExcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamblingCookieMonster%2FPSExcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamblingCookieMonster%2FPSExcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RamblingCookieMonster","download_url":"https://codeload.github.com/RamblingCookieMonster/PSExcel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999861,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epplus","excel","powershell","powershell-modules","reporting","spreadsheet"],"created_at":"2024-10-11T13:05:43.158Z","updated_at":"2025-04-09T08:09:11.504Z","avatar_url":"https://github.com/RamblingCookieMonster.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/cew1v6k58hvfiseo/branch/master?svg=true)](https://ci.appveyor.com/project/RamblingCookieMonster/psexcel)\n\nPSExcel\n=============\n\n**IMPORTANT:**  This project is no longer maintained.  Please consider Doug's excellent [ImportExcel example](https://github.com/dfinke/ImportExcel), which is frequently updated by Doug and the community.\n\nThis is a rudimentary PowerShell module for working with Excel via the [EPPlus](http://epplus.codeplex.com/) library, with no dependencies on Excel itself.\n\n* Thanks to Doug Finke for his [ImportExcel example](https://github.com/dfinke/ImportExcel) - hadn't seen EPPlus before this!\n* Thanks to Philip Thompson for his [expansive module](https://excelpslib.codeplex.com/) illustrating how to work with EPPlus in PowerShell\n* Thanks to the team and contributors behind [EPPlus](http://epplus.codeplex.com/) for a fantastic solution allowing .NET Excel interaction, without Excel.\n\nCaveats:\n\n* This covers limited functionality; contributions to this function or additional functions would be welcome!\n* Minimal testing.  Contributions welcome!\n* Naming conventions subject to change.  Suggestions welcome!\n\n## Functionality\n\n* Export random PowerShell output to Excel spreadsheets\n* Import Excel spreadsheets to PowerShell as objects\n* No dependency on Excel being installed\n\n## Instructions\n\n```powershell\n# One time setup\n    # Download the repository\n    # Unblock the zip\n    # Extract the PSExcel folder to a module path (e.g. $env:USERPROFILE\\Documents\\WindowsPowerShell\\Modules\\)\n\n    #Simple alternative, if you have PowerShell 5, or the PowerShellGet module:\n        Install-Module PSExcel\n\n# Import the module.\n    Import-Module PSExcel    #Alternatively, Import-Module \\\\Path\\To\\PSExcel\n\n# Get commands in the module\n    Get-Command -Module PSExcel\n\n# Get help for a command\n    Get-Help Import-XLSX -Full\n\n# Export data to an XLSX spreadsheet\n    Get-ChildItem C:\\ -File |\n        Export-XLSX -Path C:\\Files.xlsx\n\n# Import data from an XLSX spreadsheet\n    Import-XLSX -Path C:\\Files.xlsx\n\n```\n\n## Examples\n\nSeveral examples are available on [the accompanying blog post](http://ramblingcookiemonster.github.io/PSExcel-Intro/) and the embedded [Gist](https://gist.github.com/RamblingCookieMonster/7f49beeaebb570204581#file-zpsexcel-intro-ps1).\n\nSome highlights:\n\n### Export and import data\n\n```powershell\n#Create some demo data\n    $DemoData = 1..10 | Foreach-Object{\n\n        $EID = Get-Random -Minimum 1 -Maximum 1000\n        $Date = (Get-Date).adddays(-$EID)\n\n        New-Object -TypeName PSObject -Property @{\n            Name = \"jsmith$_\"\n            EmployeeID = $EID\n            Date = $Date\n        } | Select Name, EmployeeID, Date\n    }\n\n# Export it\n    $DemoData | Export-XLSX -Path C:\\temp\\Demo.xlsx\n\n# Import it back\n    $Imported = Import-XLSX -Path C:\\Temp\\Demo.xlsx -Header samaccountname, EID, Date\n```\n\nVerify that it exported:\n\n![Excel](http://ramblingcookiemonster.github.io/images/psexcel-intro/export.png)\n\n\nCheck the data we imported back:\n\n![Imported data](http://ramblingcookiemonster.github.io/images/psexcel-intro/imported.png)\n\n\n### Fun with formatting\n\nFreeze panes:\n\n```powershell\n# Open the previously created Excel file...\n    $Excel = New-Excel -Path C:\\temp\\Demo.xlsx\n\n# Get a Worksheet\n    $Worksheet = $Excel | Get-Worksheet -Name Worksheet1\n\n# Freeze the top row\n    $Worksheet | Set-FreezePane -Row 2\n\n# Save and close!\n    $Excel | Close-Excel -Save\n```\n\n\n![Freeze panes](http://ramblingcookiemonster.github.io/images/psexcel-intro/frozenpane.png)\n\n\nFormat the header:\n\n```powershell\n# Re-open the file\n    $Excel = New-Excel -Path C:\\temp\\Demo.xlsx\n\n# Add bold, size 15 formatting to the header\n    $Excel |\n        Get-WorkSheet |\n        Format-Cell -Header -Bold $True -Size 14\n\n# Save and re-open the saved changes\n    $Excel = $Excel | Save-Excel -Passthru\n```\n\n\n![Header format](http://ramblingcookiemonster.github.io/images/psexcel-intro/header.png)\n\n\nFormat the first column:\n\n```powershell\n#  Text was too large!  Set it to 11\n    $Excel |\n        Get-WorkSheet |\n        Format-Cell -Header -Size 11\n\n    $Excel |\n        Get-WorkSheet |\n        Format-Cell -StartColumn 1 -EndColumn 1 -Autofit -AutofitMinWidth -AutofitMaxWidth 7 -Color DarkRed\n\n# Save and close\n    $Excel | Save-Excel -Close\n```\n\n\n![First column](http://ramblingcookiemonster.github.io/images/psexcel-intro/format2.png)\n\n\n### Create tables\n\nWhy format the columns yourself? Create a table (thanks to awiddersheim!):\n\n```\n# Add a table, autofit the data.  We use force to overwrite our previous demo.\n    $DemoData | Export-XLSX -Path C:\\Temp\\Demo.xlsx -Table -Autofit -Force\n```\n\n\n![Table](http://ramblingcookiemonster.github.io/images/psexcel-intro/table.png)\n\n\n### Pivot tables and charts\n\nThis is straight from Doug Finke's fantastic [ImportExcel module](https://github.com/dfinke/ImportExcel):\n\n```powershell\n# Fun with pivot tables and charts! Props to Doug Finke\n    Get-ChildItem $env:USERPROFILE -Recurse -File |\n        Export-XLSX -Path C:\\Temp\\Files.xlsx -PivotRows Extension -PivotValues Length -ChartType Pie\n```\n\n\n[![Pivot](http://ramblingcookiemonster.github.io/images/psexcel-intro/pivot.png)](http://ramblingcookiemonster.github.io/images/psexcel-intro/pivot.png)\n\n## Notes\n\nNote that while some of these examples leverage PowerShell version 3 or later language, the module itself should work with PowerShell 2, and all Pester tests run against both PowerShell 2 and PowerShell 4.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framblingcookiemonster%2Fpsexcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framblingcookiemonster%2Fpsexcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framblingcookiemonster%2Fpsexcel/lists"}