Skip to content

Instantly share code, notes, and snippets.

View jeffpatton1971's full-sized avatar
😄
Writing code 25 hours a day, 8 days a week!

Jeff Patton jeffpatton1971

😄
Writing code 25 hours a day, 8 days a week!
View GitHub Profile
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"products": [
trigger: none
pool:
vmImage: 'windows-2019'
resources:
repositories:
- repository: tools
type: github
name: Azure-Devops-PowerShell-Module/tools
{
"subject": "linescore_mlb_2019_08_09_anamlb_bosmlb_1",
"copyright": "NOTICE: This file is no longer actively supported. Please use the MLB Stats API (http://statsapi.mlb.com/docs/) as an alternative. Copyright 2019 MLB Advanced Media, L.P. Use of any content on this page acknowledges agreement to the terms posted here http://gdx.mlb.com/components/copyright.txt",
"data": {
"game": {
"linescore": [{
"away_inning_runs": "3",
"home_inning_runs": "1",
"inning": "1"
}, {
@jeffpatton1971
jeffpatton1971 / encoding-helpers.ps1
Created March 20, 2018 15:51 — forked from jpoehls/encoding-helpers.ps1
Convert-FileEncoding and Get-FileEncoding
<#
.SYNOPSIS
Converts files to the given encoding.
Matches the include pattern recursively under the given path.
.EXAMPLE
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8
#>
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') {
$count = 0
param
(
$strFileName = "C:scriptsfile.xlsx",
$strSheetName = 'Out'
)
if (!(($strSheetName.Substring($strSheetName.Length-1,1)) -eq '$'))
{
$strSheetName = "$($strSheetName)`$"
}
$strProvider = "Provider=Microsoft.ACE.OLEDB.12.0"
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\
@jeffpatton1971
jeffpatton1971 / Get-RecentEvent.ps1
Created August 17, 2017 20:51
A script that will pull the logs from Windows that have records, between the dates specified.
param
(
$StartDate = (Get-Date),
$EndDate = (Get-Date)
)
try
{
$ErrorActionPreference = 'Stop';
$Error.Clear();
@jeffpatton1971
jeffpatton1971 / mpprovider.ps1
Created August 17, 2017 18:59
powershell you could run on a server to make sure Realtime protection is enabled
import-module 'C:\Program Files\Microsoft Security Client\MpProvider\MpProvider.psd1'
get-mprotcomputerstatus
@jeffpatton1971
jeffpatton1971 / New-Password.ps1
Last active August 16, 2017 13:52
Simple function that leverages the Crypto API to generate truly random passwords.
Function New-Password
{
<#
.SYNOPSIS
Create a new password
.DESCRIPTION
This function creates a password using the cryptographic Random Number Generator see the
MSDN link for more details.
.PARAMETER Length
An integer that defines how long the password should be
@jeffpatton1971
jeffpatton1971 / New-WordTable.ps1
Last active August 12, 2017 19:46
Updatedp version of the New-WordTable function from Boe Prox (https://learn-powershell.net/2015/01/24/creating-a-table-in-word-using-powershell/) It had a few problems as he forgot to use the selection object in creating ranges and tables.
Function New-WordTable {
[cmdletbinding(
DefaultParameterSetName='Table'
)]
Param (
[parameter()]
[object]$WordObject,
[parameter()]
[object]$Object,
[parameter()]