08 December 2014

Deployment Module

This module is designed to make automating the installation of software a breeze. It also provides logging that makes it easy to check and see if there were errors during an installation. The logging has been designed so that there is an installation log file that records all steps in the installation, an application log file that the installer creates, and finally a build.log file that records if the application was successfully installed. The build.log file provides a goto location for checking to see if all applications are installed while generating a golden image. It sequentially numbers easy application that makes it a snap to go and check if all apps are there.


The application log will give a step-by-step logging of the installation as shown below:

In order to properly install the module, it is suggested that you create the following folder: %programfiles%\windowspowershell\modules\Deployment. Next, copy the .PSD1 and PSM1 files to that folder. That is all that is needed to install the module.

The next step to using the module is the use the template I created called install.ps1. The global variables are in an array called $GlobalVariables. The function InitializeVariables is where you go in and make the appropriate modifications to the $Global:LogFile, $Global:Phase, $Global:Sequence, and $Global:Title. The Sequence is populated only if this is an installation that occurs during an image processs. If it is an image process, change Phase to Software Deployment.

Once the InitializationVariables is populated, you will insert the appropriate functions in the field that reads #<Insert Functions to install/uninstall applications>. That is all that is to this. I have been testing this out for a few months and it has made my life as an SCCM administrator much easier. I hope it does the same for you.

The module includes the following functions:


  • Copy-Files
  • Disable-WindowsFeature
  • Enable-WindowsFeature
  • Exit-PowerShell
  • Get-Architecture
  • Get-OSVersion
  • Import-RegistryFile
  • Install-EXE
  • Install-Fonts
  • Install-MSI
  • Install-MSP
  • Install-MSU
  • New-Directory
  • New-FileShortcut
  • New-LogFile
  • New-StartMenuShortcut
  • New-TaskbarShortcut
  • New-URLShortcut
  • Remove-Directory
  • Remove-DirectoryFromUserProfiles
  • Remove-File
  • Remove-FileFromUserProfiles
  • Remove-HKUKey
  • Remove-RegistryKey
  • Remove-StartMenuShortcut
  • Remove-TaskbarShortcut
  • Remove-Variables
  • Set-ConsoleTitle
  • Set-FolderPermissions
  • Set-Variables
  • Start-Task
  • Stop-Task
  • Uninstall-EXE
  • Uninstall-MSI
  • Uninstall-MSIByGUID
  • Uninstall-MSIByName
  • Wait-ProcessEnd
  • Write-LogFile

You can download the module, installer template, and manifest here:
Here is a Youtube tutorial video on how to implement the module:


Related Posts:

  • Dell Client System Update for the SCCM & MDT Build The DCSU is a great utility that Dell has made available to update the drivers and driver applications on Dell systems. The industry I work in requires specific drivers for specific applications, which makes the DCSU not a… Read More
  • Find out who is logged on and logged off Being an SCCM administrator, I often have to log into machines to see if a deployment went ok. Trying to login to machines and getting the message that someone is already logged in gets tiring. Ed Wilson originally wrote a … Read More
  • PowerShell One-Liners to ensure Dell system is configured for UEFI when imaging While planning and configuring the Windows 10 upgrades, we had to also include the transition to UEFI from BIOS. I wanted to make sure that when the build team builds new models that they are configured for UEFI when applica… Read More
  • Robocopy User Profile Contents to UNC Path The Windows 10 upgrades required us to move profile contents off of the machines to a file share and then move them back. This was because USMT could not be used due to the architecture changing from 32-bit to 64-bit. This … Read More
  • Application Uninstall Script This script will uninstall an application with just the partial description that is listed in Add/Remove programs. It searches the product list and then grabs the GUID to use in the MSI uninstallation. At current, it will o… Read More

5 comments:

  1. Can you give an example of installing a few programs using this module?

    What features does your module provide over using some of the native features of SCCM?

    ReplyDelete
  2. For one thing, it provides logging, as shown above in the first photo, to easily track if applications are being installed. You can put a pause in the task sequence that builds a golden image and check the build.log file to make sure all apps got installed. It is number sequenced making it much easier to trace through the log. I will post a couple of examples later on today.

    ReplyDelete
  3. Thank you for the repository of functions in Deployment.psm1. This alone will make life easier.

    ReplyDelete
  4. Hello are you aware of powershell app deployment toolkit (psappdeploytoolkit.codeplex.com)? If so do where this differs? Any advantages or disadvantages?

    Thanks

    ReplyDelete
    Replies
    1. Yes. This module has several more functions which the one you mentioned does not.

      Delete