Skip to content

Instantly share code, notes, and snippets.

View quonic's full-sized avatar

Spyingwind quonic

  • Dallas
View GitHub Profile
@quonic
quonic / Remove-XHunter1.ps1
Created March 11, 2023 01:26
Script to automate the removal of xhunter1.sys when found. Create a scheduled task that runs at start up as admin.
#Requires -Version 5.1 -RunAsAdministrator
function Remove-XHunter1 {
param ()
Stop-Service xhunter1 -Force -NoWait -Confirm:$false
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Services\xhunter1" -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Windows\xhunter1.sys" -Force -ErrorAction SilentlyContinue
}
function Test-XHunter1 {
@quonic
quonic / Set-StreamDeckSoundboardAudio.ps1
Last active March 7, 2023 02:47
Set-StreamDeckSoundboardAudio.ps1: A script that will allow you to change the audio Output for the Soundboard plugin for Stream Deck.
# Make sure to backup your profile, just in case that Elgato changes the file format.
# Scroll down to bottom to see example use case.
function Update-Profiles {
<#
.SYNOPSIS
Replaces outputType in all Stream Deck profiles for Elgato's Soundboard plugin.
.DESCRIPTION
@quonic
quonic / Get-BashArguments.ps1
Created February 2, 2023 23:32
Parse getopt from a bash script using PowerShell.
function Get-BashArguments {
[CmdletBinding()]
[OutputType([PSObject[]])]
param(
[Parameter(Mandatory = $true)]
# Path to a bash script
[string[]]
$Path
)
@quonic
quonic / IP Address Class.ps1
Created January 24, 2023 20:13
A simple class for defining an IPv4 address, accessing or changing any octet. Uses the Version object as the base object.
class IP {
IP([string]$Address) {
$this._IPAddress = $Address
}
hidden [Version] $_IPAddress = $($this | Add-Member ScriptProperty 'Address' {
# get
[PSCustomObject]@{
First = $this._IPAddress.Major
Second = $this._IPAddress.Minor
Third = $this._IPAddress.Build
@quonic
quonic / Install-RustDesk.ps1
Created December 5, 2022 22:12
Simple install script for RustDesk to point to your own server. Can be used in a GPO startup script.
$ErrorActionPreference = 'SilentlyContinue'
#Region Settings
# IP address of our server
$IpAddress = "127.0.0.1"
# The public key for our server
$PublicKeyString = "12345678"
# The temporary folder where we will store and run the installer
$TempFolder = "C:\Temp\"
#EndRegion Settings
@quonic
quonic / Get-PowerShellVersion.ps1
Last active August 6, 2022 04:09
Installs PowerShell/WMF 5.1 for applicable versions of Windows running on PowerShell 2.0 to 4.0. Includes script for getting PowerShell version for NinjaRMM.
#Requires -Version 2.0
<#
.SYNOPSIS
Returns the version of PowerShell installed and updates a custom field in NinjaRMM
.DESCRIPTION
Returns the version of PowerShell installed and updates a custom field in NinjaRMM if the Ninja Agent is installed.
.PARAMETER CustomField
Sets what custom field to update.
Defaults to "PowerShell" if not used.
@quonic
quonic / Get-PolicyDefinition.ps1
Last active August 1, 2022 13:30
Basic parsing of installed amdx files under C:\Windows\PolicyDefinitions\ . Defaults to en-US.
function Get-PolicyDefinition {
[CmdletBinding(
ConfirmImpact = 'None',
RemotingCapability = [System.Management.Automation.RemotingCapability]::PowerShell
)]
[OutputType([PSObject[]])]
param(
[Parameter(Mandatory = $false)]
[string[]]
$Name,
@quonic
quonic / Get-Voltage.md
Last active April 29, 2022 21:47
Get Input Voltage measurements from IPP's database for a single Eaton 5P UPS.

Example Output

Date                  Voltage
----                  -------
4/29/2022 9:49:47 AM  119.5
4/29/2022 10:10:20 AM 123.6
4/29/2022 10:10:26 AM 120.7
4/29/2022 11:10:49 AM 113.9
4/29/2022 11:10:55 AM 119.5
@quonic
quonic / Delete-Uploaded.ps1
Last active April 21, 2022 06:42
Script to upload an image to a self hosted pictshare server from Greenshot via pwsh(Powershell 7)
#Requires -Version 7
# Deletes all posts from $LogFile
[CmdletBinding()]
param (
# Log file of all requests
[string]
$LogFile = "C:\temp\pictshare_posts.json"
)
@quonic
quonic / New-QemuTemplate.ps1
Created March 16, 2022 22:10
PowerShell script that creates a Ubuntu VM template.
#!/usr/bin/pwsh
[CmdletBinding()]
param (
[Parameter()]
[string]
$ReleaseName = "focal",
[Parameter()]
[string]
$Architecture = "amd64",
[Parameter()]