Skip to content

Instantly share code, notes, and snippets.

View krzydoug's full-sized avatar

Doug Maurer krzydoug

  • Software Consulting Services
View GitHub Profile
@JustinGrote
JustinGrote / ScreenConnect.psm1
Last active January 3, 2025 15:29
ScreenConnect Client
#requires -version 7
using namespace Microsoft.PowerShell.Commands
using namespace System.Text
$ErrorActionPreference = 'Stop'
#Suppress useless IRM Verbose output
$PSDefaultParameterValues['Invoke-RestMethod:Verbose'] = $false
$PSDefaultParameterValues['Invoke-WebRequest:Verbose'] = $false
$DebugPreference = 'SilentlyContinue'
@mdgrs-mei
mdgrs-mei / TerminalSpinner.ps1
Created June 15, 2023 14:43
Show spinner on the Windows Terminal tabs for every command.
$global:originalPSConsoleHostReadLine = $function:global:PSConsoleHostReadLine
$global:originalPrompt = $function:global:Prompt
$function:global:PSConsoleHostReadLine = {
$startProgressIndicator = "`e]9;4;3;50`e\"
$command = $originalPSConsoleHostReadLine.Invoke()
$startProgressIndicator | Write-Host -NoNewLine
$command
}
@jborean93
jborean93 / Get-LogonSessionData.ps1
Created August 30, 2022 11:57
Get LSA logon session data
# Copyright: (c) 2022, Jordan Borean (@jborean93) <[email protected]>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Get-LogonSessionData {
<#
.SYNOPSIS
Get LSA logon session data.
.DESCRIPTION
Get the logon session information for all or a specific logon session or specific process logon sessions.
@jborean93
jborean93 / HttpSslCert.ps1
Created April 1, 2022 01:35
Create pwsh wrapper for netsh.exe http add|delete|show sslcert
[Flags()] enum CertCheckMode {
VerifyClientCertRevocation = 0x00000000
VerifyRevocationUsingCacheOnly = 0x00000002
DefaultRevocationFreshnessTimeIsEnabled = 0x00000004
NoUsageCheck = 0x00010000
}
[Flags()] enum SslFlags {
None = 0x00000000
UseDsMapper = 0x00000001
@0xfeeddeadbeef
0xfeeddeadbeef / Test-ProcessElevated.ps1
Last active June 20, 2024 18:26
Test whether or not a process is elevated (UAC run as admin)
function Test-ProcessElevated
{
[CmdletBinding()]
[OutputType([bool])]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[System.Diagnostics.Process] $Process
)
begin {
@jhoneill
jhoneill / Chrome Databases.ipynb
Last active June 6, 2025 07:50
Exploring data saved by Chrome/Edge/Any Chromium (passwords done in another Gist)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jborean93
jborean93 / Get-SmbShareInfo.ps1
Created May 6, 2020 19:55
Enumerates shares on a remote host
# Copyright: (c) 2020, Jordan Borean (@jborean93) <[email protected]>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Get-SmbShareInfo {
<#
.SYNOPSIS
Enumerate shares on a remote host.
.DESCRIPTION
Enumerate shares on a remote host and returns the name, type, and special remark for those shares.
@purplemonkeymad
purplemonkeymad / IPSubnet
Created March 5, 2020 16:16
Powershell class for subnet calculation.
class IPSubnet {
[ipaddress]$InitialAddress
[ValidateRange(0,128)]
[int]$SubnetLength
# basic constructor
IPSubnet([ipaddress]$InitialAddress,[int]$SubnetLength){
$this.InitialAddress = $InitialAddress
$this.SubnetLength = $SubnetLength
@JustinGrote
JustinGrote / Get-NetworkDeviceConfig.ps1
Created June 22, 2018 20:56
Get the running configuration from a network device using Powershell. Supports Cisco and JunOS
#requires -module Posh-SSH
param (
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)][String]$Computername,
[ValidateSet("Cisco","JunOS")]
[Parameter(ValueFromPipelineByPropertyName)][String]$DeviceType = "Cisco",
[String]$RepositoryPath = $home\desktop,
[PSCredential]$Credential
)
@mt7479
mt7479 / CorrectRecoveryPartitionSize.ps1
Last active May 6, 2024 02:45
Resize the recovery partition on Windows 10 Systems to save some space
<#
Correct the default UEFI partition layout created by ConfigMgr to save some disk space.
https://docs.microsoft.com/de-de/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions
## Notes:
* The recovery partition size for Windows 10 1703 needs to be at least 900 MB or the partition will ignored.
* Windows 10 1511 Winre.wim size: 313.009.179 Bytes
* Windows 10 1607 Winre.wim size: 324.995.101 Bytes