Skip to content

Instantly share code, notes, and snippets.

@ChadDevOps
ChadDevOps / ShortNames-ZipFiles-SLTSVGtoPNG.ps1
Last active Aug 24, 2021
Generates a random shortname for directories, unzips files, generates png from stl, generates png from svg
View ShortNames-ZipFiles-SLTSVGtoPNG.ps1
# Run as admin
# Summary: Generates a random shortname for directories, unzips files, generates png from stl, generates png from svg
# Pre-req:
# Install OpenSCAD (Ex using chocolatey: choco install openscad -y)
# Install inkscape (ex using choco: choco install inkscape -y)
# Install superdelete (ex using choco: choco install superdelete -y)
# Enable Shortnames in Windows 10 by running the following commands (helps with 260 char. limits):
# fsutil 8dot3name query
# fsutil behavior set disable8dot3 0
# Post [optional]
@ChadDevOps
ChadDevOps / copyall.ps1
Created Jul 22, 2021
Copy all files to new folder in parent directory, rename if same
View copyall.ps1
function fcopy ($SourceDir,$DestinationDir)
{
Get-ChildItem $SourceDir -Recurse | Where-Object { $_.PSIsContainer -eq $false } | ForEach-Object ($_) {
$SourceFile = $_.FullName
$DestinationFile = $DestinationDir + $_
write-host "------------------------------------"
write-host "Source: $SourceFile"
write-host "Dest : $DestinationFile"
if (Test-Path "$DestinationFile"){
if( (Get-FileHash "$SourceFile").Hash -ne (Get-FileHash "$DestinationFile").Hash ) {