This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -version 7.3 | |
# this is one of Stéphane BARIZIEN's public domain scripts | |
# the most recent version can be found at: | |
# https://gist.github.com/sba923/bc52cf74197ab3cddce825e8b502e28b#file-export-csvwithmilliseconds-ps1 | |
<# | |
.SYNOPSIS | |
Proxy for Export-Csv that adds milliseconds to DateTime properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is one of Stéphane BARIZIEN's public domain scripts | |
# the most recent version can be found at: | |
# https://gist.github.com/sba923/792b13b3cd8e14eabd92963622a10de0#file-ctime-ps1 | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline)] | |
$Item, | |
[Parameter(Position=0)][int] $Days | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
$iswinps = ($null, 'Desktop') -contains $PSVersionTable.PSEdition | |
if (!$iswinps) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is one of Stéphane BARIZIEN's public domain scripts | |
# the most recent version can be found at: | |
# https://gist.github.com/sba923/54a260dbd0fcd6672de13cf9e81b41db#file-resolve-shortpath-ps1 | |
param([Parameter(Mandatory = $true)][string] $Path) | |
# derived from https://devblogs.microsoft.com/scripting/use-powershell-to-display-short-file-and-folder-names/ | |
$item = Get-Item -Path $Path -ErrorAction SilentlyContinue | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this is one of Stéphane BARIZIEN's public domain scripts | |
# the most recent version can be found at: | |
# https://gist.github.com/sba923/d0d5ad16f2b12d7785adf830b0395dc2#file-df-ps1 | |
function Format-AsKMG | |
{ | |
param ($bytes,$precision='0') | |
foreach ($i in ("","KB","MB","GB","TB")) | |
{ | |
if (($bytes -lt 1000) -or ($i -eq "TB")) |
NewerOlder