This file contains 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
Set-StrictMode -Version 3 | |
# Make sure to fill in $source and $dest before use. | |
$source =# source-directory | |
$dest =# destination-directory | |
Get-ChildItem -Path $source -Recurse | ForEach-Object { | |
If ((Test-Path $dest\$_) -and !(Test-Path $dest\$_.bak)) {Rename-Item $dest\$_ -NewName "$_.bak" } | |
} | |
Copy-Item $source\* -Destination $dest |
This file contains 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
Set-StrictMode -Version 3.0 | |
#Requires -Version 5.1 | |
function Group-Item { | |
<# | |
.SYNOPSIS | |
Rename and organize files. | |
.DESCRIPTION | |
Rename files to a given name, followed by a four digit number. | |
The original files will be moved to a folder titled "originals". |
This file contains 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
Set-StrictMode -Version 3.0 | |
#Requires -Version 5.1 | |
Function Invoke-Mogrify { | |
<# | |
.SYNOPSIS | |
Convert images to other formats using ImageMagick. | |
.DESCRIPTION | |
This function will convert given images into the specified format. | |
The converted images will be saved to the same location as the original images by default. |
This file contains 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
Set-StrictMode -Version 3.0 | |
#Requires -Version 3.0 | |
[int]$Hours = Read-Host -Prompt "Enter the number of hours" | |
[int]$Minutes = Read-Host -Prompt "Enter the number of minutes" | |
[int]$Seconds = Read-Host -Prompt "Enter the number of seconds" | |
if(-not($Hours)){ | |
$Hours = 0 | |
} | |
if(-not($Minutes)){ |
This file contains 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
Set-StrictMode -Version 3.0 | |
#Requires -Version 7.0 | |
# Find missing numbers in a list of file names containing four digit numbers in parentheses. | |
# Outputs list of missing numbers to pipeline. | |
[System.Int32[]]$Iteration = Get-ChildItem $Path | Where-Object{$_.Name -match "\(\d{4}\)"} | ForEach-Object{$Matches[0]} | |
$Iteration[0]..$Iteration[-1] | Where-Object{$_ -notin $Iteration} |
This file contains 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
Set-StrictMode -Version 3.0 | |
#Requires -Version 5.1 | |
# Rename files to match the pattern of a name, followed by a four digit number in parentheses. | |
# Example: "Test (0001)", "Test (0002)". | |
[string]$Name = Read-Host -Prompt "What name would you like the files to follow?" | |
[string]$Destination = Read-Host -Prompt "Where are the files you would like to rename?" | |
[string]$Extension = ( $Value = Read-Host -Prompt "What extension should the script search for? Leave this blank to rename all." ) ? $Value : '*' |
This file contains 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 5.1 | |
Set-StrictMode -Version 3.0 | |
function New-Launcher { | |
[CmdletBinding()] | |
param( | |
[Parameter()] | |
[ValidateSet('CMD','Shortcut')] | |
[string]$Type = 'CMD', |
This file contains 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
Set-StrictMode -Version 3.0 | |
#Requires -Version 5.1 | |
# Get used space on a drive, then warn if storage usage exceeds 65%. | |
function Get-DriveInfo { | |
[CmdletBinding()] | |
param( | |
$InformationPreference= "Continue", | |
[int]$WarnPercent = '75' |
This file contains 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
function Convert-Distance { | |
<# | |
.SYNOPSIS | |
Convert units of distance from metric to imperial and vise versa. | |
.DESCRIPTION | |
Convert units of distance from the input unit to the output unit. Supported units are the millimetre (mm), centimetre (cm), metre (m), kilometre (km), inch (in), foot (ft), | |
yard (yd), and mile (mi). | |
.PARAMETER Value |
This file contains 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 5.1 | |
#Requires -Modules PowerShellForGitHub,PSMenu | |
Set-StrictMode -Version 3.0 | |
$InformationPreference = 'Continue' | |
function Get-PrivateRelease { | |
<# | |
.SYNOPSIS | |
Download a release from a GitHub repository. |
OlderNewer