Skip to content

Instantly share code, notes, and snippets.

View realslacker's full-sized avatar

Shannon Graybrook realslacker

View GitHub Profile
@realslacker
realslacker / Remove-AppxProvisionedPackagesFromWim.ps1
Created January 30, 2018 18:57
Removes Provisioned Appx Packages from a WIM file to allow Windows to be deployed without the provisioned apps pre-installed.
<#
.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)
<#
.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 March 29, 2018 20:26
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.
@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
<#
.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
<#
.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 July 20, 2018 23:33
One liner to bump up TLS available for Invoke-WebRequest, Invoke-RestMethod, etc...
# 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 / Get-GroupwiseProxyAccess.ps1
Created August 23, 2018 19:50
Reads proxy access information from GroupWise 2012 or later. Uses the SOAP API to fetch proxy access ACLs from GroupWise.
<#
.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.
<#
.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
<#
.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
<#
.SYNOPSIS
Test for a wireless profile from an exported XML file or by Name.
.DESCRIPTION
Test for a wireless profile from an exported XML file, checks for a minimum and/or maximum version if supplied.
Author: Shannon Brooks