Skip to content

Commit e97befe

Browse files
committed
7zip moduel add readme file, icon and build def
1 parent 880dbc7 commit e97befe

File tree

4 files changed

+244
-0
lines changed

4 files changed

+244
-0
lines changed

7Zip/Assets/Icon.ico

9.91 KB
Binary file not shown.

7Zip/Assets/Icon.pdn

16.1 KB
Binary file not shown.

7Zip/README.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# 7zip - 7zip utility warpper
2+
3+
*Can download utility from internet
4+
*Use own bin floder
5+
6+
[![PowerShell 3](https://Stadub-Gh.visualstudio.com/PowershellScripts/_apis/build/status/7Zip?branchName=master)](https://Stadub-Gh.visualstudio.com/PowershellScripts/_build/latest?definitionId=3?branchName=master)
7+
[![PowerShell 4, 5 & Core on Windows build](https://ci.appveyor.com/api/projects/status/7tmg8wy30ipanjsd?svg=true)](https://ci.appveyor.com/project/stadub/powershellscripts)
8+
<!-- [![Linux & MacOS build](https://img.shields.io/travis/stadub/PowershellScripts/master.svg?label=linux/macos+build)](https://travis-ci.org/stadub/PowershellScripts) -->
9+
[![latest version](https://img.shields.io/powershellgallery/v/7Zip.svg?label=latest+version)](https://www.powershellgallery.com/packages/7Zip/)
10+
[![downloads](https://img.shields.io/powershellgallery/dt/7Zip.svg?label=download)](https://www.powershellgallery.com/packages/7Zip)
11+
12+
<!-- [Documentation](https://powershellscripts.readthedocs.io/en/latest/) -->
13+
14+
<!-- ![ConsoleDemo](https://raw.githubusercontent.com/stadub/PowershellScripts/master/7Zip/Assets/demo.gif) -->
15+
16+
## Instalation
17+
18+
Powershell Gallery:
19+
20+
[![https://www.powershellgallery.com/packages/7Zip/](https://img.shields.io/badge/PowerShell%20Gallery-download-blue.svg?style=popout&logo=powershell)](https://www.powershellgallery.com/packages/7Zip/)
21+
22+
`PowerShellGet` Installation :
23+
24+
```powershell
25+
Install-Module -Name 7Zip
26+
```
27+
28+
Direct download instalation:
29+
30+
```powershell
31+
iex ('$module="7zip"'+(new-object net.webclient).DownloadString('https://raw.githubusercontent.com/stadub/PowershellScripts/master/install.ps1'))
32+
```
33+
34+
Module import:
35+
36+
```powershell
37+
Import-Module 7Zip
38+
```
39+
40+
## Commands
41+
42+
```powershell
43+
Read-ZipFile - List 7zip file content
44+
[-Archive] <string>
45+
[-Password] <string> (Optional)
46+
47+
Add-ZipFileContent - Adds file to archive
48+
[-Archive] <string>
49+
[-File] <string>
50+
[-Password] <string> (Optional)
51+
52+
Remove-ZipFileContent - Remove file from archive
53+
[-Archive] <string>
54+
[-File] <string>
55+
[-Password] <string> (Optional)
56+
57+
New-ZipFile - Create new archive (single file)
58+
[-Archive] <string>
59+
[-File] <string>
60+
[-Compression] (Optional) {Store, Fastest, Fast, Normal, Maximum, Ultra}
61+
[-Password] <string> (Optional)
62+
[-SplitSize] <string> (Optional)
63+
[-PathFormat] (Optional) {Realtive, Full, Absolute}
64+
[-FileMode] (Optional) {Add, Update, Freshen, Sync}
65+
66+
New-ZipFile - Create new archive (Files list)
67+
[-Archive] <string>
68+
[-File] <string>
69+
[-Files] <string[]>
70+
[-Compression] (Optional) {Store, Fastest, Fast, Normal, Maximum, Ultra}
71+
[-Password] <string> (Optional)
72+
[-SplitSize] <string> (Optional)
73+
[-PathFormat] (Optional) {Realtive, Full, Absolute}
74+
[-FileMode] (Optional) {Add, Update, Freshen, Sync}
75+
76+
Test-ZipFileContent - Perform zip file check
77+
[-Archive] <string>
78+
[-File] <string> (Optional)
79+
[-Password] <string> (Optional)
80+
81+
```
82+
83+
## Aliases
84+
85+
| Cmdlet | Alias |
86+
| ---------------------|:------:|
87+
| Read-ZipFile | szr |
88+
| Add-ZipFileContent | sza |
89+
| Remove-ZipFileContent| szrm |
90+
| Test-ZipFileContent | szt |
91+
| Get-ZipFileContent | sz |
92+
93+
## Usage
94+
95+
List 7zip file content:
96+
97+
```powershell
98+
/>Read-ZipFile -Archive 'file.7z'
99+
```
100+
101+
```powershell
102+
/>Read-ZipFile -Archive 'encodedFile.7z' -Password 'pass'
103+
```
104+
105+
```powershell
106+
/> ./file.7z | Read-ZipFile
107+
```
108+
109+
Add file to archive:
110+
111+
```powershell
112+
/>Add-ZipFileContent -Archive 'folder.7z' -File 'file.txt'
113+
```
114+
115+
```powershell
116+
/> ./file.txt | Add-ZipFileContent -Archive 'File.7z'
117+
```
118+
119+
```powershell
120+
/> ./file.txt | Add-ZipFileContent -Archive 'encodedFile.7z' -Password "pass"
121+
```
122+
123+
Remove file from archive:
124+
125+
```powershell
126+
/>Remove-ZipFileContent -Archive 'folder.7z' -File 'file.txt'
127+
```
128+
129+
```powershell
130+
/> ./File.7z | Remove-ZipFileContent -File 'file.txt'
131+
```
132+
133+
```powershell
134+
/> ./encodedFile.7z | Remove-ZipFileContent -File 'file.txt' -Password 'pass'
135+
```
136+
137+
Create new 7zip archive from file
138+
139+
```powershell
140+
/> New-ZipFile -Archive 'folder.7z' -File 'file.txt'
141+
```
142+
143+
```powershell
144+
/> ./file.txt | New-ZipFileContent -Archive 'encodedFile.7z' -Password 'pass' -Compression Ultra -SplitSize '10mb' -PathFormat Absolute -FileMode Update
145+
```
146+
147+
Create new 7zip archive from file list
148+
149+
```powershell
150+
/> New-ZipFile -Archive folder.7z -Files 'file1.txt', 'file2.txt'
151+
```
152+
153+
```powershell
154+
/> ls | New-ZipFileContent -Archive encodedFolder.7z -Password "pass" -Compression Store -SplitSize "1gb" -PathFormat Full -FileMode Sync
155+
```
156+
157+
Perform 7Zip arhive integrity check
158+
159+
```powershell
160+
/>Test-ZipFileContent -Archive 'folder.7z'
161+
```
162+
s
163+
```powershell
164+
/>Test-ZipFileContent -Archive 'folder.7z' -File 'file.txt'
165+
```
166+
167+
```powershell
168+
/> ([PSCustomObject]@{File='file.txt', Archive='File.7z', Password="pass"} | Test-ZipFileContent -Archive 'File.7z'
169+
```
170+
171+
## Changelog
172+
173+
### [v0.9.5](https://github.com/stadub/PowershellScripts/releases/tag/v0.3.1)
174+
175+
* Add module methods description.
176+
* Adding Icon/Readme file/Usage video.
177+
178+
### [v0.9.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.3.0)
179+
180+
* Adding unit tests
181+
* Added function `Remove-AllPSBookmarks`
182+
* Add `Test-ZipFileContent` function
183+
* Rename `Check7Zip` to `Test-7ZipInstall`
184+
185+
### [v0.8.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.2.0)
186+
187+
* Adding unit tests for all functions
188+
* Refactor methods and extract worker process function to `Start-7Zip`
189+
* Fix functions load flow.
190+
* Move initalization to separated function.
191+
192+
### [v0.7.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.1.0)
193+
194+
* Add the `Remove-ZipFileContent` `Read-ZipFile` functions
195+
* Separate functions and aliases.
196+
197+
### [v0.6.0](https://github.com/stadub/PowershellScripts/releases/tag/v0.1.0)
198+
199+
* Extracted module from the `FolderEncoder` project and move to individual folder.
200+
* Rename `Encode7zip` `Decode7Zip` to `Add-ZipFileContent` and `Get-ZipFileContent` functions
201+
202+
## Motivation
203+
204+
The modules are creasted and actively maintained during evenings and weekends.
205+
If it's useful for you too, that's great. I don't demand anything in return.
206+
207+
However, if you like it and feel the urge to give something back,
208+
a coffee or a beer is always appreciated. Thank you very much in advance.
209+
210+
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png)](https://www.buymeacoffee.com/dima) [![Support by Yandex](https://raw.githubusercontent.com/GitStatic/Resources/master/yaMoney.png)](https://money.yandex.ru/to/410014572567962/200)
211+
212+
<!-- By Paypal [![PayPal.me](https://img.shields.io/badge/PayPal-me-blue.svg?maxAge=2592000)](https://www.paypal.me/dima.by)
213+
-->
214+
215+
If you have any idea or suggestion - please add a github issue.
216+
217+
<!-- https://www.contributor-covenant.org/version/1/4/code-of-conduct -->

7Zip/azure-pipelines.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
trigger:
2+
- master
3+
pr:
4+
- master
5+
6+
resources:
7+
- repo: self
8+
clean: true
9+
fetchDepth: 1
10+
11+
jobs:
12+
- job: 7zip
13+
displayName: 7zip
14+
continueOnError: false
15+
pool:
16+
vmImage: 'windows-2019'
17+
workspace:
18+
clean: all
19+
timeoutInMinutes: 3
20+
steps:
21+
- powershell: |
22+
$global:PesterDebugPreference_ShowFullErrors = $true
23+
$errorActionPreference = 'stop'
24+
Set-StrictMode -Version Latest
25+
Install-Module -Name Pester -Force
26+
Import-Module Pester
27+
. .\7zip\7zip.Tests.ps1

0 commit comments

Comments
 (0)