Skip to content

Instantly share code, notes, and snippets.

@mono0x
Created May 30, 2022 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mono0x/a3ffd00e69ce8233eeccef347c861115 to your computer and use it in GitHub Desktop.
Save mono0x/a3ffd00e69ce8233eeccef347c861115 to your computer and use it in GitHub Desktop.
Param(
[Parameter(Mandatory, Position = 0)]
[String]$Source,
[Parameter(Mandatory, Position = 1)]
[String]$Destination,
[System.DateOnly]$Date = ([System.DateOnly]::FromDateTime([System.DateTime]::Now)),
[Parameter(Mandatory, Position = 2)]
[String]$Name
)
$ErrorActionPreference = 'Stop'
$result = Copy-Item -PassThru -Path $Source -Destination (
New-Item -Type Directory -Force (
Join-Path $Destination ("{0}\{0}-{1,2:00}\{0}-{1,2:00}-{2,2:00} {3}" -f $Date.Year, $Date.Month, $Date.Day, $Name)
)
)
. (Join-Path (Split-Path -Parent $PSCommandPath) Rename-Videos.ps1) $result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment