Last active
February 22, 2017 22:41
-
-
Save kinshuk4/9c3034aedccda9f7c31ac2ef123a57e3 to your computer and use it in GitHub Desktop.
This file contains 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
//remove 4 from the file name and replace it with empty string | |
get-childitem -path c:\test -filter *4* -Recurse | rename-item -newname {$_.name -replace "4",""} | |
get-childitem -path G:\Lyf\EDU2 -filter *’* -Recurse | rename-item -newname {$_.name -replace "’",""} | |
gci G:\Lyf\EDU2\2\Coursera\FIN -r *.csv ` | |
| Where-Object { ... } ` | |
| ForEach-Object { & 7z $_.FullName".zip" $_.FullName} | |
Compress-Archive -Path | |
7z a b.zip b | |
gci C:\temp -r *.csv ` | |
| Where-Object { ... } ` | |
| ForEach-Object { & 'c:\temp\bin\gzip.exe' $_.FullName} | |
G:\Lyf\EDU2\3\Coursera\CS | |
$dir = dir G:\Lyf\EDU2\3\Coursera\CS | ?{$_.PSISContainer} | |
foreach ($d in $dir){ | |
$name = Join-Path -Path $d.FullName -ChildPath ($d.Name + ".zip") | |
$path = Join-Path -Path $d.FullName -ChildPath "*" | |
& "7z" a $name $path | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment