Skip to content

Instantly share code, notes, and snippets.

View sba923's full-sized avatar

Stéphane BARIZIEN sba923

  • Charenton-le-Pont, France
View GitHub Profile
@sba923
sba923 / keybase.md
Created March 13, 2020 17:17
Keybase proof

Keybase proof

I hereby claim:

  • I am sba923 on github.
  • I am sba923 (https://keybase.io/sba923) on keybase.
  • I have a public key ASBwrNN-i-QirfdeH4UXtgkEZhEYx2na6VFiGchq3nHTzAo

To claim this, I am signing this object:

@sba923
sba923 / ConvertFrom-WingetStdout.ps1
Last active October 28, 2024 16:00
Convert winget output to PowerShell objects
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/7924b726fd44af91d18453ee595e6548#file-convertfrom-wingetstdout-ps1
#requires -version 7
# This crude script converts the output of the winget.exe executable into an array of PowerShell objects
# usage: winget <args> | ConvertFrom-WingetStdout.ps1
#
# examples of application:
@sba923
sba923 / df.ps1
Last active May 4, 2026 08:52
*nix work-alike's for PowerShell: df, dirname, whatis, whence
<#
.SYNOPSIS
Displays disk usage statistics for local and network drives, similar to the Unix 'df' command.
.DESCRIPTION
This script lists all logical drives on the system, showing their total size, free space, percent free, and percent used.
It supports filtering by drive letter and can output results as objects for further processing.
.PARAMETER PassThru
If specified, outputs objects instead of a formatted table, suitable for piping or further processing.
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/571e7b02bddab9c587ee97110b898629#file-remove-emptydirectories-ps1
param([string] $Path, [switch] $IgnoreSystemFiles, [switch] $ToRecycleBin, [switch] $ContinueOnErrors)
if (!(Test-Path -Path $Path))
{
throw("'{0}' not found" -f $Path)
}
@sba923
sba923 / Update-SeleniumDriver.ps1
Last active March 22, 2026 19:25
Update Selenium drivers found on the PATH
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/d5406e7fded598b9c1131ddf9f099564#file-update-seleniumdriver-ps1
[CmdletBinding()]
param(
[Parameter(ParameterSetName = 'InstallIfMissing', Mandatory = $true)][switch] $InstallIfMissing,
[Parameter(ParameterSetName = 'InstallIfMissing', Mandatory = $true)][string] $Destination,
[Parameter(ParameterSetName = 'NoParameters')] [switch] $_NeverUseThisParameter,
[switch]$ClearCache
@sba923
sba923 / mtime.ps1
Last active January 31, 2024 14:49
Helper for "gci ... | mtime x" PowerShell equivalent to "find ... -mtime x"
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/0395f7fd716d87cf92d52946b10a30b7#file-mtime-ps1
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
$Item,
[Parameter(Position=0)][int] $Days
)
@sba923
sba923 / Resolve-ShortPath.ps1
Last active April 24, 2026 08:16
Resolve path to short (8.3) version
<#
.SYNOPSIS
Resolves a filesystem path to its DOS 8.3 short path.
.DESCRIPTION
Uses the Scripting.FileSystemObject COM API to compute the short name of each
path component and returns the resolved path object with an added `ShortPath`
property.
Only filesystem paths are supported.
@sba923
sba923 / Convert-DateTimePropertiesToStringWithMilliseconds.ps1
Last active September 30, 2024 19:57
Convert all DateTime properties of objects on the pipeline to strings including milliseconds, to work around Export-CSV's limitation
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/ddc6e300e2bbe3f01d1ee20276d0cfe4#file-convert-datetimepropertiestostringwithmilliseconds-ps1
#requires -Version 7.3
# this rewrites the objects on the pipeline so that DateTime members are replaced with a string representation including milliseconds
# to work around the fact Export-CSV doesn't include milliseconds (see https://github.com/PowerShell/PowerShell/issues/19536)
# compute millisecond-aware version of the current datetime format
@sba923
sba923 / Remove-UselessKeyboardLayouts.ps1
Last active February 17, 2026 05:54
Remove the unwanted keyboard layouts that Windows keeps adding based on input languages
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/a71dd721e78ae08842616db244f19437#file-remove-uselesskeyboardLayouts-ps1
[CmdletBinding()]
param([string] $PhysicalKeyboardLayout)
# cSpell: ignore Stéphane BARIZIEN's
$isWinPS = ($null, 'Desktop') -contains $PSVersionTable.PSEdition
@sba923
sba923 / Get-ZoomItHelp.ps1
Last active May 22, 2026 07:23
Utilities to help working with Sysinternals ZoomIt
# this is one of Stéphane BARIZIEN's public domain scripts
# the most recent version can be found at:
# https://gist.github.com/sba923/7ea3d013b1f758a947eea6c2e4f89f73#file-get-zoomIthelp-ps1
<#
.SYNOPSIS
Show help for ZoomIt functions, with currently configured hotkeys
.DESCRIPTION
This script outputs help information the ZoomIt functions