This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Usage: | |
# | |
#NOTE: Remember to include the path to Microsoft-Windows-PowerShell%4Operational.evtx below. | |
# | |
#C:\>ExtractAllScripts.ps1 | |
#The default behavior of the script is to assimilate and extract every script/command to disk. | |
# | |
#C:\ExtractAllScripts -List | |
#This will only list Script Block IDs with associated Script Names(if logged.) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Write-Log { | |
Param( | |
$Message, | |
$Path = "$env:USERPROFILE\log.txt" | |
) | |
function TS {Get-Date -Format 'hh:mm:ss'} | |
"[$(TS)]$Message" | Tee-Object -FilePath $Path -Append | Write-Verbose | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 2 | |
function Get-AdobeFlashMsi { | |
[CmdletBinding()] | |
param ( | |
[string] | |
$Destination = $(Join-Path -Path $env:USERPROFILE -ChildPath 'Downloads' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script performs the installation or uninstallation of an application(s). | |
# LICENSE # | |
PowerShell App Deployment Toolkit - Provides a set of functions to perform common application deployment tasks on Windows. | |
Copyright (C) 2017 - Sean Lillis, Dan Cunningham, Muhammad Mashwani, Aman Motazedian. | |
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. | |
.DESCRIPTION | |
The script is provided as a template to perform an install or uninstall of an applica |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding(DefaultParameterSetName='Version')] | |
param | |
( | |
[Parameter(ParameterSetName='Latest', Mandatory = $true)] | |
[Parameter(ParameterSetName='Version', Mandatory = $true)] | |
[String] | |
$SaveToPath, | |
[Parameter(ParameterSetName='Version', Mandatory = $true)] | |
[String] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-PSADTAppVersion { | |
<# | |
.SYNOPSIS | |
Gets the $appversion varible for a given PSADT package | |
.DESCRIPTION | |
Gets the $appversion varible for a given PSADT package | |
Queries the Deploy-Application.ps1 file for "appversion" | |
Takes the first string returned. I don't care about other occerences in the file | |
Converts it to a string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
This script performs the installation or uninstallation of an application(s). | |
.DESCRIPTION | |
The script is provided as a template to perform an install or uninstall of an application(s). | |
The script either performs an "Install" deployment type or an "Uninstall" deployment type. | |
The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install. | |
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application. | |
.PARAMETER DeploymentType | |
The type of deployment to perform. Default is: Install. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### "#region AND #endregion HELP MAKE SCRIPTS COLLAPSIBLE WITHIN THE ISE" ### | |
### FIND AND CHANGE THE <WHATEVER> PLACEHOLDERS I PUT AS I SCRUBBED THE FILE ### | |
### PLACE THIS FILE IN THE FOLLOWING FOLDER (CREATE IT IF IT DOESN'T EXIST) : C:\USERS\<USERNAME>\DOCUMENTS\WINDOWSPOWERSHELL ### | |
#region Console Customization | |
#ELEVATED CONSOLE? | |
[System.Security.Principal.WindowsPrincipal]$global:currentUser = | |
New-Object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent()) | |
if($global:currentUser.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Commonly used PSADT env variables | |
$envCommonDesktop # C:\Users\Public\Desktop | |
$envCommonPrograms # C:\ProgramData\Microsoft\Windows\Start Menu\Programs | |
$envProgramFiles # C:\Program Files | |
$envProgramFilesX86 # C:\Program Files (x86) | |
$envProgramData # c:\ProgramData | |
$envUserDesktop # c:\Users\{user currently logged in}\Desktop | |
$envUserStartMenuPrograms # c:\Users\{user currently logged in}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs | |
$envSystemDrive # c: | |
$envWinDir # c:\windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
This snippet is for use in a PSADT script. It assumes you have added parameters, or hardcoded the following | |
* $DeploymentID - The deployment ID of the task sequence you want to check the cache for, and which will be invoked | |
* $CheckAC - A boolean (or switch) that determines if you want to force the user to plug in prior to upgrading. This step is only check if | |
the pre-caching has passed | |
#> | |
#region Validate that all content is pre-cached so we do not bother the user until the TS is ready to start | |
$TS = Get-WmiObject -Namespace ROOT\ccm\Policy\Machine\ActualConfig -Class CCM_SoftwareDistribution -Filter "ADV_AdvertisementID='$DeploymentID'" -Property PKG_PackageID, PKG_Name | |
if ($null -ne $TS) { |
NewerOlder