Skip to content

Instantly share code, notes, and snippets.

View severud's full-sized avatar
🙌
Trying to automate all the things

Kevin Severud severud

🙌
Trying to automate all the things
View GitHub Profile
@bharkr
bharkr / Get-RemoteUserSessions.ps1
Created April 14, 2025 17:04
Retrieves user login information from remote computers within the last 60 days.
#region Script Header
<#
.SYNOPSIS
Retrieves user login information from remote computers within the last 60 days.
.DESCRIPTION
This script queries remote computers for user login events within the last 60 days.
It retrieves the username, computer name, login time, and session type.
The script is designed for PowerShell Core and utilizes best practices for performance.
@bharkr
bharkr / Create-DHCPReport.ps1
Last active June 5, 2025 16:32
Create a report on Windows DHCP servers
<#
.SYNOPSIS
Creates an Excel workbook with DHCP server information.
.DESCRIPTION
This script retrieves DHCP server summary data and subnet reservation data from the DHCP server and creates an Excel workbook with the information.
.PARAMETER SummaryData
Specifies the DHCP server summary data to be included in the workbook.
@bharkr
bharkr / Install-ZabbixAgent.ps1
Last active February 4, 2026 01:24
Install Zabbix Agent Windows
function Install-ZabbixAgent {
[CmdletBinding()]
param(
[Parameter]
[string]$ComputerName='localhost',
[Parameter(Mandatory=$true)]
[string]$ZabbixUrl
)
@JustinGrote
JustinGrote / Write-FunctionError.ps1
Last active February 28, 2023 21:57
Write an Error within a function in a nice way that displays the context of the function rather than the "Write-Error" context
using namespace System.Management.Automation
using namespace Microsoft.PowerShell.Commands
function Write-FunctionError {
<#
.SYNOPSIS
Writes an error within the context of the containing CmdletBinding() function. Makes errr displays prettier
#>
param(
[Parameter(Mandatory)][String]$Message,
[ValidateNotNullOrEmpty()][ErrorCategory]$Category = 'WriteError',
@jdhitsolutions
jdhitsolutions / Show-WeatherSummary.ps1
Created February 18, 2021 14:38
A PowerShell function that displays weather information using the wttr.in REST API.
#requires -version 5.1
<#
this must be run in a Windows Terminal or console session that supports the
emoji icons or use -Force if you know you are.
see https://github.com/chubin/wttr.in for API information
This command writes to the host not the PowerShell pipeline.
#>
@EriksRemess
EriksRemess / 60-leds.rules
Last active September 23, 2020 12:21
Turn off (or change color of) Gigabyte X570 I AORUS PRO WIFI motherboard RGB LEDs.
#---------------------------------------------------------------#
# User hidraw Access #
#---------------------------------------------------------------#
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", TAG+="uaccess"
#---------------------------------------------------------------#
# Gigabyte/Aorus RGB Fusion 2 USB #
#---------------------------------------------------------------#
SUBSYSTEMS=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="8297", TAG+="uaccess"
@jdhitsolutions
jdhitsolutions / LCR.ps1
Last active April 22, 2020 18:23
A PowerShell version of the LCR dice game.
#requires -version 5.1
<#
A PowerShell version of the LCR dice game.
Player 1 sits at the top of the player circle. Subsequent players
are positioned clockwise.
This script writes to the host not to the pipeline.
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
@pcgeek86
pcgeek86 / cheatsheet.ps1
Last active March 18, 2026 19:42
PowerShell Cheat Sheet / Quick Reference
Get-Command # Retrieves a list of all the commands available to PowerShell
# (native binaries in $env:PATH + cmdlets / functions from PowerShell modules)
Get-Command -Module Microsoft* # Retrieves a list of all the PowerShell commands exported from modules named Microsoft*
Get-Command -Name *item # Retrieves a list of all commands (native binaries + PowerShell commands) ending in "item"
Get-Help # Get all help topics
Get-Help -Name about_Variables # Get help for a specific about_* topic (aka. man page)
Get-Help -Name Get-Command # Get help for a specific PowerShell function
Get-Help -Name Get-Command -Parameter Module # Get help for a specific parameter on a specific command