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.