Skip to content

Instantly share code, notes, and snippets.

Mathias R. Jessen IISResetMe

  • Netherlands
Block or report user

Report or block IISResetMe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Compare-Array.ps1
function Compare-Array
$max = [math]::Max($Ref.Length,$Diff.Length)
for($i = 0; $i -lt $max; $i++){
View Compare-Array.ps1
function Compare-Array
$max = [math]::Max($Ref.Length,$Diff.Length)
for($i = 0; $i -lt $max; $i++){
View TrackRIDPools.ps1
if(-not (Get-CimInstance -ClassName Win32_ComputerSystem -Property DomainRole).DomainRole -band 4){
# Computer's not a DC
$logProperties = @{
LogName = 'System'
Source = 'RIDPoolTracker'
if (-not(Get-Eventlog -List | Where-Object {$_.LogDisplayName -eq $logProperties.LogName})) {
IISResetMe / Log-ChromeExtension.ps1
Created Jun 13, 2019
Discover chrome extensions and log information about them to event log
View Log-ChromeExtension.ps1
Inventory Chrome Extension information and dump the info to the Windows Event Log
This is a simplified adaptation of zsattler's Set-ChromeExtensions.ps1 which writes extension info to a WMI namespace for SCCM to pick up
This version writes the information to a custom Windows Event Log instead, easily picked up for WEF or similar log forwarding tools.
Original script:
Original blog post:
View ConditionalRegex.koan.ps1
using module PSKoans
[Koan(Position = 666)]
Describe "Regex" {
It "breaks your brainz" {
$res = __ -match '^(?<pp>a )must-have tool(?(pp)|s)'
$res |Should -Be $true
IISResetMe / PSTextEncodingConverter.class.ps1
Created May 28, 2019
System.Text.Encoding converter to easy argument conversion
View PSTextEncodingConverter.class.ps1
using namespace System.Management.Automation
using namespace System.Text
class PSTextEncodingConverter : PSTypeConverter {
$ConversionTable = @{
'ASCII' = [System.Text.Encoding]::ASCII
'ANSI' = [System.Text.Encoding]::ASCII
IISResetMe / Sort-Reverse.ps1
Created May 27, 2019
Array Reversal in the pipeline
View Sort-Reverse.ps1
# terrible
function Sort-VarReverse {
# sorting rank = max
$rank = [int]::MaxValue
$input |Sort-Object {
# decrement $rank in parent scope, reversing the input order
(--(Get-Variable rank -Scope 1).Value)
View VisitorKittenz.ps1
using namespace System.Collections.Generic
using namespace System.Management.Automation.Language
#region AstVisitor
class VisitorKitten : ICustomAstVisitor
$temp = $ast
$count = 0
while($temp -and $temp -ne $temp.Parent){
View Get-DistinctUnion.ps1
function Get-DistinctUnion
$temp = [System.Collections.Generic.HashSet[object]]::new($Source)
IISResetMe / GetFileTime.ps1
Last active Apr 24, 2019
Fast acquisition of LastWriteTime attribute value of files via Kernel32.dll
View GetFileTime.ps1
$kernel32,$filetime = Add-Type -TypeDefinition @'
// Partial port of the C# example at
using System;
using System.Runtime.InteropServices;
public class Kernel32wrappers {
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
You can’t perform that action at this time.