Skip to content

Instantly share code, notes, and snippets.

View asheroto's full-sized avatar
:electron:
Calculating Universe

asheroto

:electron:
Calculating Universe
View GitHub Profile
@indented-automation
indented-automation / SystemTray.ps1
Created July 22, 2022 10:36
Functions to allow changes to the visibility of icons in the system tray.
enum Visibility : byte {
Default = 0
Hide = 1
Show = 2
}
function Convert-CeaserCipher {
<#
.SYNOPSIS
Convert a string to and from a ceaser cipher (ROT-13) encoding.
@indented-automation
indented-automation / Watch-WinEvent.ps1
Created July 13, 2022 19:07
Event log subscriber
function Watch-WinEvent {
<#
.SYNOPSIS
Watch for events matching a query in the event log.
.DESCRIPTION
Watch for events matching a query in the event log.
#>
@asheroto
asheroto / EnableRDP.ps1
Last active December 26, 2023 07:13
Enable RDP on a computer with PowerShell.
# Warning
Clear-Host
Write-Output "Run this script on the computer you want to access via RDP"
Write-Output ""
# Ask
Write-Output "Remote address can be an IP address or network with CIDR"
Write-Output "Example: 192.168.0.5 or 192.168.0.0/24"
Write-Output ""
$RemoteAddress = Read-Host "Remote Address"
@asheroto
asheroto / IsPortActive.md
Last active June 24, 2023 06:53
Check if a port is active/open/listening in PowerShell.
using namespace System.Collections.Generic; using namespace System.Text
Add-Type -TypeDefinition '
using System;
using System.Runtime.InteropServices;
using System.Text;
public class WindowTools
{
public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam);
@PatrickLang
PatrickLang / README.md
Last active June 10, 2024 18:36
Yubikey + Windows

Using a Yubikey 4 on Windows

These are my notes on how to set up GPG with the private key stored on the hardware Yubikey. This will reduce the chances of your GPG private key from being stolen, and also allow you to protect other secrets such as SSH private keys.

It's just some notes and a partial worklog for now, but I may turn it into a full blog post later.

@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active December 23, 2024 10:03
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@indented-automation
indented-automation / Get-CommandSource.ps1
Last active July 7, 2024 00:08
View the source for a command
function Get-CommandSource {
param (
[Parameter(Mandatory)]
[String]$Name
)
try {
$commandInfo = Get-Command $Name
if ($commandInfo -is [System.Management.Automation.AliasInfo]) {
$commandInfo = $commandInfo.ResolvedCommand
@indented-automation
indented-automation / Get-InstalledSoftware.ps1
Last active December 11, 2024 14:45
Get-InstalledSoftware
function Get-InstalledSoftware {
<#
.SYNOPSIS
Get all installed from the Uninstall keys in the registry.
.DESCRIPTION
Read a list of installed software from each Uninstall key.
This function provides an alternative to using Win32_Product.
.EXAMPLE
Get-InstalledSoftware
@indented-automation
indented-automation / New-DynamicParameter.ps1
Last active August 11, 2023 22:46
New-DynamicParameter
function New-DynamicParameter {
<#
.SYNOPSIS
Create a new dynamic parameter object for use with a dynamicparam block.
.DESCRIPTION
New-DynamicParameter allows simplified creation of runtime (dynamic) parameters.
.EXAMPLE
New-DynamicParameter Name -DefaultValue "Test" -ParameterType "String" -Mandatory -ValidateSet "Test", "Live"
.EXAMPLE
New-DynamicParameter Name -ValueFromPipelineByPropertyName