Introduction
Who This Book Is For
How This Book is Organised
- Code
- The Sum of Its Parts
- Part 1: Why Use PowerShell?
PowerShell Cmdlets
- Write-Host
- Get-Location
- Set-Location
- Push-Location \ Pop-Location
- Get-Process \ Stop-Process
- Start-Process
- New-Item
- New-ItemProperty
- Get-Item
- Test-Path
- Try \ Catch
- Copy-Item
- Try It Out
- The Story so Far
- Part 2: MSIEXEC
Fundamentals
- View the help
- Where Is It?
- Better to use $Env:
Parameters
- Installation
- Silent Install
- No Restart
- Uninstall
- Note
Properties
- Which Properties Can I Set?
- How to Find Valid Property Values
- Tip!
Uninstall GUIDs
- 32-bit Installations
- 64-bit Installations
- TIP!
Setup.exe
- Example MSI Extraction
The Story so Far
- Part 3: Detection Rules
Why Use PowerShell?
Detection Fundamentals
- The Microsoft “Rules”
- In Practice
- Use the Docs
- Note
- Where Do I Put My Detection Rules Anyway?
- Silently Continue
Detection Rule Context
- Why Context Matters
- The Solution
- To Summarise
Detection Types
- File \ Folder Presence
- Executable Presence
- Executable Version
Top Tip!
- Registry Key
- Registry Value
Custom Detection
- Why Use Custom Detection?
- By File
- Remember!
- Write to the File Contents
- By Registry
Branching
- By Office Bitness
Examples
- Mimecast Detection (Branching Example)
- Java Detection (This and This)
The Story so Far
- Part 4: Location, Location, Location
Where Is This Script Running from Anyway?
- How We Used to Do Things
- The Various Solutions
- A Better Way
File Placement
- Where to Place Your Files for Deployment
Referencing Files
- Referencing Files in a Flat Structure
- Referencing Files in Subdirectories
- If You’re Elsewhere…
- And Finally…
The Story so Far
- Part 5: Installing the Program
Calling the MSI or Setup.exe
Start Your Engines Please
Parameters
- -FilePath
- Top Tip
- -ArgumentList
- -NoNewWindow
- -Wait
Dealing with Spaces
Putting It All Together
- Example 1 - Simple MSI
- Example 2 - MSI with Properties
- Example 3 - Setup.Exe
The Story so Far
- Part 6: Deploying the Script
Calling Your Script
- Standard Script (Top to bottom)
- Script with Entry Point
- Function
- Watch Your Dots!
- Function Accepting Parameters
The Story so Far
- Part 7: Deployment Template
How to Use
- Deploying Based on Office ‘Bitness’
- Note!
- Deploying Based on Operating System Architecture
- Pre-Deployment Tasks
- Post-Deployment Tasks
- Logging
- How to Call the Template
- Lead by Example
The Story so Far
- Part 8: Useful Code Snippets
- Detect Office ‘Bitness’
- Watch Out!
- Detect Operating System Architecture
- Obtaining the Current Logged in User Name
- Better to Use $ENV:?
- Copying Files
- Did you Know?
- No Include
- Register \ Unregister DLL’s
- Use the Template!
- Part 9: Real-World Examples
Ready to go Scripts
- Adobe Reader
- Java
- Firefox
- Mimecast
- Fusion Excel Connect Client
- Tips
- Bonus Chapter 1
A Step-by-Step Guide to Deploying a CCMCache Resize
- The Scenario
- Bonus Chapter 2
A Step-by-Step Guide to Deploying EMC SourceOne Agent for Offline Files
- Objectives
- Download and Extract the Files!
- Move the Files to the SCCM Source Location
- Discover the Silent Deployment Switches
- The Deployment Template
- Download the Pre-Configured Deployment Template
- Create The Application
- Installation Program
- The Detection Rule
- Traditional Method
- PowerShell Method
- Lock and Load
- Summary
- Bonus Chapter 3
A Step-by-Step Guide to Deploying RSAT Components for Windows 10
- Background
- Get the Script
- Install-RSATCapabilities
- Uninstall-RSATCapabilities
- Season to Taste
- Move the Script to the SCCM Source Location
- Create The Application
- Installation Program
- The Detection Rule
- Watchout!
- Distribute and Deploy
- The Result
- Afterword