Skip to content

Commit

Permalink
(GH-73) Fill in WIP page for PowerShell
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Nov 27, 2020
1 parent 55c4109 commit 05e9b11
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions input/en-us/features/powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@ Order: 20
xref: packaging-for-the-masses
Title: Packaging for the masses - PowerShell
Description: At its heart, Chocolatey uses the Windows Automation Language, PowerShell, to perform its different operations
ShowInNavBar: false
ShowInSideBar: false
---

> :warning: **WARNING** This is a Work in Progress. Please check back later.
Released in November 2006, Windows PowerShell, quickly became the defacto way to automate tasks on Windows. Whether it was automating the creation of Users within Active Directory, or configuring/maintaining your Exchange Server, PowerShell was the way to do it.

When Chocolatey started, it was clear that PowerShell was going to be at the heart of how it works as well, and that continues to this day.

Within a Chocolatey package, there are three main PowerShell files:

- chocolateyInstall.ps1
- chocolateyUninstall.ps1
- chocolateyBeforeModify.ps1

> :memo: **NOTE** Not all of these files are required within every Chocolatey package, as Chocolatey performs a number of tasks automatically, and overrdiing the dfeault functionality is only required when you want to do something different.
When a Chocolatey package is installed/uninstalled, these files are executed at [different times](xref:create-packages#during-which-scenarios-will-my-custom-scripts-be-triggered), giving a [package creator](xref:create-your-own-packages) full control over exactly what actions are performed within a package.

This flexibility allows for the creation of simple packages (that simply execute a native installer) all the way up to highly complicated installations that perform several operations.

On top of this, Chocolatey ships with a number of [built-in functions](xref:powershell-reference), to help with the specific tasks of installing applications, binaries, zips, and scripts.

When you need to create your own custom PowerShell functions, Chocolatey provides the ability to create [extension packages](xref:extensions), to allow the sharing of code across multiple packages, rather than duplicating it.

0 comments on commit 05e9b11

Please sign in to comment.