Skip to content

Instantly share code, notes, and snippets.

@webtroter
webtroter / Copy-ACLFromTemplateToTarget.ps1
Last active July 3, 2024 22:11
Small script to copy the ACE matching a group from a Template directory to a target Directory (and only this one, no descendant)
<#
.SYNOPSIS
To add the File Shares Operators in the ACL with the template permissions on a single directory
.DESCRIPTION
Ce script ajoute l'entrée pour le groupe 'File Shares Operators'(ou le groupe spécifié) dans les ACL du répertoire choisi
afin que celui-ci puis gérer les permissions sans lire le contenu.
This Script adds ACEs that allows a FileSharesOperators Group to manages the ACL on the directory without allowing
the group to read the content of files.
@webtroter
webtroter / Move.ps1
Created December 5, 2023 00:25
Move files with date in a date subfolder
# Execute this PowerShell from inside your directory.
# Adjust the pattern based on your needs. Don't include the extension
# Filename for this pattern : Replay_2023-12-01_21-04-14.mp4
$pattern = "Replay_(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})_(?<hour>\d{2})-(?<minute>\d{2})-(?<second>\d{2})"
Get-ChildItem -Filter "*.mp4" | % {
if ($_.Basename -match $pattern) {
$Matches.Remove(0)
$filedate = Get-Date @Matches
@webtroter
webtroter / Invoke-UpdateAndLaunchDrawIO.ps1
Created January 18, 2024 23:19
Check and Update Draw IO Desktop No Install for Windows
#Requires -Version 7
[CmdletBinding(DefaultParameterSetName = "Check")]
param (
# Check Switch
[Parameter(ParameterSetName="Check", Mandatory)]
[Parameter(ParameterSetName="CheckAndUpdate")]
[switch]
$Check,
@webtroter
webtroter / Get-RobotAvatarImage.ps1
Created March 13, 2024 16:13
Obtain a Robot Avatar from Robohash.org, using a seed string
[CmdletBinding(DefaultParameterSetName="Interactive")]
param (
# Parameter help description
[Parameter(ParameterSetName="Interactive")]
[switch]
$Interactive,
[Parameter(ParameterSetName="InputString")]
[string]
$InputString,
# Set
@webtroter
webtroter / Allow-PingNetFirewall.ps1
Created March 25, 2024 17:57
Add "Allow PING" to Windows Firewall
$newNetFirewallRuleSplat = @{
Name = "ICMP-Ping"
DisplayName = "Allow ICMP Ping"
Profile = 'Any'
Direction = 'Inbound'
Action = 'Allow'
Enabled = 'True'
RemoteAddress = "0.0.0.0/0"
Protocol = 'ICMPv4'
EdgeTraversalPolicy = 'Allow'
@webtroter
webtroter / Obsidian Tasker Project.excalidraw.svg
Last active August 10, 2024 16:13
Obsidian Tasker Project
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@webtroter
webtroter / Invoke-Caffeine.ps1
Created August 5, 2025 16:27
Invoke-Caffeine - To keep your computer from Sleeping
function Invoke-Caffeine {
param (
[string]$Key = '{F15}',
[int]$Delay = 30
)
begin {
# Create WScript.Shell COM object
$wshell = New-Object -ComObject WScript.Shell
# Create a stopwatch to track elapsed time
@webtroter
webtroter / Disable Navy.md
Created April 3, 2026 03:30
My BAR CRD Discord Archive
title Disable Navy
source https://discord.com/channels/1357449862748045417/1444491124436766873

Tweak Defs

!bset tweakdefs LS0gdjEuMCBTdGFuaXMgMDctTWF5LTIwMjQKCi0tIFJlc3RyaWN0IFNoaXB5YXJkcwotLSBSZXN0cmljdCBTaGlwcyBieSBNb3ZlbWVudCBDbGFzcyAiQk9BVAoKbG9jYWwgZmFjdG9yaWVzYXJyYXk9eyJjb3JzeSIsImFybXN5IiwibGVnc3kiLCJjb3Jhc3kiLCJhcm1hc3kiLCJsZWdhc3kifQoKZm9yIGEsYiBpbiBwYWlycyhVbml0RGVmcykgZG8gCgoJaWYgYi5tb3ZlbWVudGNsYXNzIGFuZCBzdHJpbmcuZmluZChiLm1vdmVtZW50Y2xhc3MsIkJPQVQiKSB0aGVuIAoJCWIudW5pdHJlc3RyaWN0ZWQ9MAkKCWVuZAoKCWZvciBrLHYgaW4gcGFpcnMoZmFjdG9yaWVzYXJyYXkpIGRvIAoJCWlmIGE9PXYgdGhlbgoJCQliLnVuaXRyZXN0cmljdGVkPTAJCgkJCWJyZWFrCgkJZW5kCgllbmQJCQplbmQ7