Skip to content

Instantly share code, notes, and snippets.

Avatar

Shannon Brooks realslacker

View GitHub Profile
@realslacker
realslacker / Remove-AppxProvisionedPackagesFromWim.ps1
Created Jan 30, 2018
Removes Provisioned Appx Packages from a WIM file to allow Windows to be deployed without the provisioned apps pre-installed.
View Remove-AppxProvisionedPackagesFromWim.ps1
<#
.SYNOPSIS
Removing Built-in apps from Windows 10 / Windows 8.1 / Windows 8
.DESCRIPTION
Removing Built-in apps from Windows 10 / Windows 8.1 / Windows 8
.PARAMETER Path
The path to the WIM image file (typically install.wim)
View NetTests.psm1
<#
.SYNOPSIS
Helper function to test a TCP port.
.DESCRIPTION
Helper function to test a TCP port.
.PARAMETER Destination
DNS name or IP address of the host to test.
@realslacker
realslacker / wpkg.cmd
Last active Mar 29, 2018
Place in System32 directory to allow you to run WPKG from the command line. Relies on Elevate (see http://code.kliu.org/misc/elevate/) to launch as administrator.
View wpkg.cmd
@ECHO OFF
SET ALLARGS=
SET CLOSEMODE=
REM Verify that elevate is installed
IF EXIST C:\Windows\System32\elevate.exe GOTO :SKIPERROR
ECHO This script must be run with Administrator rights!
PAUSE
EXIT 1
:SKIPERROR
View Format-MACAddress.ps1
<#
.SYNOPSIS
Reformats a MAC Address depending on the use case.
.DESCRIPTION
Takes a string or strings that should be reformated as a MAC address.
.PARAMETER Address
The MAC Address to reformat as a string
.PARAMETER Separator
What separator should be inserted, defaults to ':'
.EXAMPLE
View Convert-BytesToHumanReadable.ps1
<#
.SUMMARY
Converts bytes values into human readable forms.
.DESCRIPTION
Converts bytes values into human readable forms.
.PARAMETER Bytes
Input in Bytes
@realslacker
realslacker / Profile.ps1
Created Jul 20, 2018
One liner to bump up TLS available for Invoke-WebRequest, Invoke-RestMethod, etc...
View Profile.ps1
# Bump up the TLS profile to the max value supported by your system
[System.Enum]::GetValues('Net.SecurityProtocolType') |
Where-Object { $_ -gt [System.Math]::Max( [Net.ServicePointManager]::SecurityProtocol.value__, [Net.SecurityProtocolType]::Tls.value__ ) } |
ForEach-Object {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_
}
# The rest of your Profile.ps1 ...
@realslacker
realslacker / Remove-McAfee.ps1
Created Apr 18, 2018
Runs McAfee MFERemoval100.exe with a valid date for the uninstaller. Tested with Q1 2018 uninstaller. In my use case I used PS1_to_EXE to package the uninstaller and script together and run silently.
View Remove-McAfee.ps1
if ( -not (Test-Path "$env:ProgramW6432\McAfee") -and -not(Test-Path "${env:ProgramFiles(x86)}\McAfee") ) { exit 0 }
$OriginalDate = Get-Date
# Set the date back to allow MFERemoval to run
Set-Date -Date '01/01/2018'
# Run removal tool
Start-Process -FilePath "$PWD\MFERemoval100.exe" -ArgumentList '/noreboot','/q','/all','/force' -Wait
@realslacker
realslacker / Get-GroupwiseProxyAccess.ps1
Created Aug 23, 2018
Reads proxy access information from GroupWise 2012 or later. Uses the SOAP API to fetch proxy access ACLs from GroupWise.
View Get-GroupwiseProxyAccess.ps1
<#
.SYNOPSIS
Reads proxy access information from GroupWise 2012 or later.
.DESCRIPTION
Reads proxy access information from GroupWise 2012 or later. Uses the SOAP API to fetch proxy access ACLs from GroupWise.
.PARAMETER User
User(s) to query proxy access for.
View Remove-WiFiProfile.ps1
<#
.SYNOPSIS
Removes a wireless profile from an exported XML file.
.DESCRIPTION
Removes a wireless profile from an exported XML file, clears the version from the registry.
Author: Shannon Brooks
View Install-WiFiProfile.ps1
<#
.SYNOPSIS
Installs a wireless profile from an exported XML file.
.DESCRIPTION
Installs a wireless profile from an exported XML file, stores the version (install date and time) in the registry.
Author: Shannon Brooks