Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| powershell:qnd:file_operations [2022/06/16 16:34] – mgupton | powershell:qnd:file_operations [2022/10/06 20:13] (current) – mgupton | ||
|---|---|---|---|
| Line 95: | Line 95: | ||
| </ | </ | ||
| + | Unzip zip archives contained in another zip archive. | ||
| + | <code powershell> | ||
| + | Expand-Archive -DestinationPath .\zips ' | ||
| + | ls .\zips\ | % {Expand-Archive -DestinationPath $env:temp $_.FullName} | ||
| + | </ | ||
| + | === Create a folder with name following scheme === | ||
| + | <code powershell> | ||
| + | $suffix = 1 | ||
| + | |||
| + | while ((Test-Path " | ||
| + | $suffix += 1 | ||
| + | } | ||
| + | |||
| + | mkdir " | ||
| + | </ | ||
| + | |||
| + | <code powershell> | ||
| + | $names = @(" | ||
| + | |||
| + | $name = 0 | ||
| + | |||
| + | while ($name -lt $names.Count) { | ||
| + | if ((Test-Path " | ||
| + | break | ||
| + | } | ||
| + | |||
| + | $name += 1 | ||
| + | } | ||
| + | |||
| + | if ($name -eq $names.Count) { | ||
| + | $name = 0 | ||
| + | } | ||
| + | |||
| + | mkdir " | ||
| + | </ | ||