Last active
March 15, 2016 11:13
-
-
Save thorade/e4dec248c95d49d40fcd to your computer and use it in GitHub Desktop.
PowerShell script that recursively scans a given directory and prints a list of all file extenions
This file contains hidden or 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
# This PowerShell Script will recursively scan all files in the given $scanDir | |
# and print a list of all file extensions it finds | |
# | |
# get current directory | |
$curPath = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$curDir = Split-Path -Leaf -Path $curPath | |
$scanDir = "BuildingSystems" | |
$scanPath = $curPath + "\" + $scanDir | |
$outFile = $scanPath + "\fileExtensions.txt" | |
# print the list of file extensions | |
Get-ChildItem $scanPath -recurse | Select-Object Extension | Sort-Object Extension | Get-Unique -asString | Out-File $outFile | |
#Read-Host "Press Enter to close" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment