Created
March 21, 2022 06:59
-
-
Save yanonono/066f520a6803028a0aeb0ae9c56e2316 to your computer and use it in GitHub Desktop.
フォルダをzip化するPowerShell
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
| # フォルダ名+".zip"でzip化 | |
| Get-ChildItem ./ -Directory | Where-Object { | |
| $dirname = Split-Path $_ -Leaf | |
| $zipFile = ".\{0}.zip" -f $dirname | |
| Compress-Archive -Path $_ -DestinationPath $zipFile | |
| } |
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
| # フォルダ名+(フォルダの最終更新日時)+".zip"でzip化 | |
| Get-ChildItem ./VRChat* -Directory | Where-Object { | |
| $lastUpdate = $(Get-ItemProperty $_).LastWriteTime.ToString("yyyyMMdd_HHmmss") | |
| $dirname = Split-Path $_ -Leaf | |
| $zipFile = ".\{0}.{1}.zip" -f $dirname, $lastUpdate | |
| Write-Output $zipFile | |
| Compress-Archive -Path $_ -DestinationPath $zipFile | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment