Skip to content

Instantly share code, notes, and snippets.

@Kavignon
Forked from martin-morin/PowerShell-snippets.ps1
Created February 19, 2020 16:19
Show Gist options
  • Save Kavignon/76778cc0913cafaf6e51f3f604752b1a to your computer and use it in GitHub Desktop.
Save Kavignon/76778cc0913cafaf6e51f3f604752b1a to your computer and use it in GitHub Desktop.
My favorite PowerShell snippets
# List of usefull snipets I always reuse.
# Get all file types
$extensionList = @((Get-ChildItem -Recurse -File).Extension);
$extensionList | Select-Object -Unique
# Snippets for git support in the team
# -------------------------------------------
# When someone cannot checkout the files from lfs (whatever the user does, the file remain empty with a size of 1K)
# Experienced with git lfs version: 2.9.2
# Try the standard way to get the file with the following:
git lfs fetch --all
git lfs checkout
# If this does not work, se the following sequence to clear the caches:
# ( Make sure there are no uncommitted changes. If there are some, commit the work if required before proceeding. )
git rm -r --cached .
git reset --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment