Source: https://nishanth-fern-test.docs-staging.pageloop.ai/web/deploy-a-package-using-powershell

# Deploy a Package using PowerShell Script

The following steps highlight the order in which you need to create a program and deploy the Whatfix extension as a **Package**:

- **Create a Package:** Package the Whatfix extension in a format that SCCM can distribute (For example, an installer file).
- **Create a Program:** In SCCM, specifies what actions the tool should perform, such as install or uninstall the extension.
- **Deploy the Extension:** SCCM then distributes the extension to the targeted machines with the option to forcefully install or make it available for your end users to install the extension.

> [!WARNING]
>
> The following steps, for example, show how you can create a package to install the Whatfix extension on Chrome browser using Powershell.

Expand the following accordions to learn how to configure and deploy Whatfix extension as a package using a PowerShell script:

#### **Step 1: Create a package and choose program type**

The following example shows the steps to create the Whatfix extension on Chrome using Powershell:

1. On your Windows system, open the **Configuration Manager Console**. ![](/images/f0/sccm_open_console-f0068ede.jpg)
2. Click **Software Library**. ![](/images/9b/sccm_software_library-9be04b74.jpg)
3. Expand **Application Management**. ![](/images/a3/sccm_software_library_expand_app_management-a3f2732a.jpg)
4. Right-click **Packages**, and then click **Create Package**. ![](/images/41/sccm_packages_create_package-411c9ac0.jpg)
5. In the Create a **Package and Program Wizard**, specify a name and other information. ![](/images/ee/sccm_package_wizard_info-ee12410e.jpg)
6. Select the **This package contains source files** checkbox. ![](/images/57/sccm_package_wizard_source_files_checkbox-573cd1e0.jpg)
7. Click **Browse**. ![](/images/98/sccm_package_wizard_browse-98cbfed8.jpg)
8. In the **Set Source folder** window, select **Network path (UNC name)**, and then click **Browse** once again. ![](/images/dd/sccm_package_wizard_network_browse-dd10fb01.jpg)
9. Select or enter a source path and then click **Ok**. ![](/images/90/sccm_package_wizard_browse_path_ok-90f49119.jpg)

> [!INFO]
>
> A folder must be created in the primary site server where you [download and save the PowerShell script](/web/single-installer-for-whatfix-extensions). In this step, select the location of the source folder. For example, `\\wfx-sccmps01\Whatfix Packages\Powershell`.

10. Select **Standard program**. ![](/images/fc/sccm_package_wizard_standard_program-fc2b246c.jpg)
11. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
12. In the **Specify information about this standard program** section, enter the following information for each field: - **Name**: Install Extension on Chrome - **Command line**: `powershell.exe -executionpolicy bypass -file "Whatfix-ExtensionInstall.ps1" -Browser Chrome` - **Run**: Hidden - **Program can run**: Whether or not a user is logged in - **Drive mode**: Runs with UNC name ![](/images/78/sccm_package_wizard_program_fields-78a0777f.jpg)

> [!INFO]
>
> - If you want to create a program to install the package on Edge, use the following command line: `powershell.exe -executionpolicy bypass -file "Whatfix-ExtensionInstall.ps1" -Browser Edge`

13. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
14. Select **This program can run on any platform**. ![](/images/d1/sccm_package_sys_req_plat-d1e29349.jpg)
15. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
16. Verify the settings in the Details field, and then click **Next**. ![](/images/b7/sccm_package_wizard_summary-b72d6429.jpg)

> [!INFO]
>
> The **Completion** section displays the following message if the Package is created successfully: ![](/images/64/sccm_package_wizard_success-6439eb9a.jpg)

#### Step 2: Deploy the extension

Use the following steps to deploy the Whatfix extension:

1. Select the PowerShell package. ![](/images/d3/image-643-d32362ff.png)
2. Right-click the program, and then click **Deploy**. ![](/images/e0/image-644-e0a404b8.png)
3. Click **Browse** to select a **Collection**. ![](/images/01/sccm_package_depoly_browse-01bf9997.jpg)
4. Select a collection, and then click **Ok**. A Collection is a group of devices on which you want to deploy the extension. ![](/images/d8/sccm_package_deploy_collection_ok-d88ee6b6.jpg)
5. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
6. Expand the **Add** dropdown, and then click **Distribution Point**. A distribution point is a server where the packages are hosted. ![](/images/d9/sccm_package_depoly_add_distribution_point-d9bbecee.jpg)
7. Select the distribution points that will host the Package. ![](/images/10/sccm_package_depoly_select_distribution_points-102fa197.jpg)
8. In the **Deployment Settings** tab, set the purpose to **Required**, and the other settings as follows: ![](/images/b3/image-641-b33a20b0.png)
9. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
10. In the **Schedule** tab, click **New**. ![](/images/df/image-642-df947879.png)
11. Select the **Assign immediately after this event** option, and then click **Ok**. ![](/images/db/image-635-db3df0f3.png)
12. In the **Rerurn behavior** field, select the **Return if failed previous attempt** option. ![](/images/44/sccm_package_depoly_run_behaviour-448ce9d4.jpg)
13. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
14. In the **User Experience** tab, select the options show in the following image: ![](/images/a9/sccm_package_depoly_schedule_UX-a98730b1.jpg)
15. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
16. Select **Download content from the distribution point and run locally** option for both the **Deployment options** highlighted in the following image: ![](/images/3c/sccm_package_depoly_deployment_options-3c9b5c18.jpg)
17. Click **Next**. ![](/images/f0/image-717-f000d79a.png)
18. Verify the changes in the **Summary** tab, and then click **Next**. The wizard starts deploying the extension. ![](/images/9d/sccm_package_depoly_summary-9d050b1e.jpg)

> [!INFO]
>
> The **Completion** tab displays the following message if the Package was deployed successfully: ![](/images/92/sccm_package_depoly_task_succesful-9256bc37.jpg)

To know more about creating an uninstall program, see [Create an Uninstall Program using PowerShell](/web/create-an-uninstall-program-using-powershell-for-an-sccm-package).
