Skip to content

Instantly share code, notes, and snippets.

@martin-morin
Last active March 24, 2020 19:38
Show Gist options
  • Save martin-morin/705a2593e81bf549955c57281c9594cf to your computer and use it in GitHub Desktop.
Save martin-morin/705a2593e81bf549955c57281c9594cf 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
# Snippets for git command with token authentication
# --------------------------------------------------
git -c http.extraheader="x-access-token: token <your token here>" <yout git command here>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment