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
@jeffpatton1971
jeffpatton1971 / Get-WinEventTail.ps1
Last active December 14, 2023 16:59
This function will allow you to tail Windows Event Logs. You specify a Logname for either the original logs, Application, System and Security or the new format for the newer logs Microsoft-Windows-PowerShell/Operational
Function Get-WinEventTail
{
<#
.SYNOPSIS
A tail cmdlet for Eventlogs
.DESCRIPTION
This function will allow you to tail Windows Event Logs. You specify
a Logname for either the original logs, Application, System and Security or
the new format for the newer logs Microsoft-Windows-PowerShell/Operational
.PARAMETER LogName
@jeffpatton1971
jeffpatton1971 / New-RulesFromNetstat.ps1
Created January 15, 2014 17:11
A script to create firewall rules based on netstat output
<#
Create FW rules for TCP and UDP Listening Ports
netstat -an -p tcp |Select-String "Listening"
netstat -an -p udp |Select-String "Listening"
for each entry in netstat create firewall rule
name = -p tcp|udp port port #
description = automatic allow rule generated by powershell on get-date
@jeffpatton1971
jeffpatton1971 / Export-FederationConfigurationV2.ps1
Last active October 7, 2023 12:59
This is the Export-FederationConfiguration.ps1 and Import-FederationConfiguration.ps1 files that are found in the C:\Windows\ADFS folder. I have made a few minor changes in each see this thread for details. https://social.technet.microsoft.com/Forums/en-US/02a5594b-00df-4731-ae98-992956bafc19/adfs-unable-to-export-the-adfs-configuration?forum=wi…
<#############################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
############################################################>
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="Medium", DefaultParameterSetName="Default")]
Param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelinebyPropertyName=$true)]
[string] $Path,
[Parameter(Mandatory=$false)]
@jeffpatton1971
jeffpatton1971 / retrosheet_zip_files.TXT
Created March 25, 2015 22:19
A list of retrosheet download urls
http://www.retrosheet.org/events/1952eve.zip
http://www.retrosheet.org/events/1953eve.zip
http://www.retrosheet.org/events/1954eve.zip
http://www.retrosheet.org/events/1955eve.zip
http://www.retrosheet.org/events/1956eve.zip
http://www.retrosheet.org/events/1957eve.zip
http://www.retrosheet.org/events/1958eve.zip
http://www.retrosheet.org/events/1959eve.zip
http://www.retrosheet.org/events/1960eve.zip
http://www.retrosheet.org/events/1961eve.zip
@jeffpatton1971
jeffpatton1971 / Setup-Server.ps1
Last active September 12, 2021 16:07
Configure the SQL LowPriv Environment.
<#
This script will configure the local machine for the SQL MP
Low Privilege Environment
We need to set the following items on the server
Add SQLDefaultAction account and SQLMonitor account to
Performance Monitor Users
Add SQLDefaultAction account and SQLMonitor account to
{
"$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": [
@jeffpatton1971
jeffpatton1971 / Get-BingImage.ps1
Last active December 25, 2020 06:40
This script can be used to download Bing background images for use as your wallpaper or to save. It uses a specially crafted URL that I found while searching for a way to download them. It appears that the URL will let you go back 18 days, or the last 8 images. When you set Index to 18 and NumberOfImages to 8 a total of 19 images will be downloa…
<#
.SYNOPSIS
Use this script to download the Bing background image.
.DESCRIPTION
This script can be used to download Bing background images for use
as your wallpaper or to save. It uses a specially crafted URL that I
found while searching for a way to download them.
It appears that the URL will let you go back 18 days, or the last 8
images. When you set Index to 18 and NumberOfImages to 8 a total of
@jeffpatton1971
jeffpatton1971 / New-HelpFile.ps1
Last active September 3, 2020 15:36
This script will build output to the screen a properly formatted XML help file. I based this on one of the installed helpfiles in System32.
<#
.SYNOPSIS
This script will generate a proper XML helpfile
.DESCRIPTION
This script will build output to the screen a properly formatted
XML help file. I based this on one of the installed helpfiles
in System32.
.PARAMETER Commands
You can pass in the output from Get-Command cmdletname or you
can pass in Get-Command -Module moduleName
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"
}, {