2023-11-19 17:41:47

This commit is contained in:
z17CX 2023-11-19 17:41:47 +00:00
parent 627fa73153
commit 2193182f77
Signed by: z17cx
GPG key ID: 3F5F87C84EE943E4
7 changed files with 69 additions and 10 deletions

View file

@ -69,7 +69,7 @@ RequiredModules = @('PkgStore.Kernel')
# NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Compress-7z', 'Compress-7zAuto', 'Compress-ISO', 'Expand-7z'
FunctionsToExport = 'Compress-7z', 'Compress-7zBulk', 'Compress-ISO', 'Expand-7z'
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

View file

@ -1,9 +1,9 @@
$ModuleManifest = (Get-ChildItem -Path $PSScriptRoot | Where-Object {$_.Extension -eq '.psd1'})
$ModuleManifest = (Get-ChildItem -Path $PSScriptRoot | Where-Object { $_.Extension -eq '.psd1' })
$CurrentManifest = (Test-ModuleManifest $ModuleManifest)
$Aliases = @()
$PrivateFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Private') | Where-Object {$_.Extension -eq '.ps1'})
$PublicFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') | Where-Object {$_.Extension -eq '.ps1'})
$PrivateFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Private') | Where-Object { $_.Extension -eq '.ps1' })
$PublicFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') | Where-Object { $_.Extension -eq '.ps1' })
(@($PrivateFunctions) + @($PublicFunctions)) | ForEach-Object {
try {
@ -25,10 +25,10 @@ $PublicFunctions = (Get-ChildItem -Path (Join-Path $PSScriptRoot 'Public') | Whe
}
}
$FunctionsAdded = ($PublicFunctions | Where-Object {$_.BaseName -notin $CurrentManifest.ExportedFunctions.Keys})
$FunctionsRemoved = ($CurrentManifest.ExportedFunctions.Keys | Where-Object {$_ -notin $PublicFunctions.BaseName})
$AliasesAdded = ($Aliases | Where-Object {$_ -notin $CurrentManifest.ExportedAliases.Keys})
$AliasesRemoved = ($CurrentManifest.ExportedAliases.Keys | Where-Object {$_ -notin $Aliases})
$FunctionsAdded = ($PublicFunctions | Where-Object { $_.BaseName -notin $CurrentManifest.ExportedFunctions.Keys })
$FunctionsRemoved = ($CurrentManifest.ExportedFunctions.Keys | Where-Object { $_ -notin $PublicFunctions.BaseName })
$AliasesAdded = ($Aliases | Where-Object { $_ -notin $CurrentManifest.ExportedAliases.Keys })
$AliasesRemoved = ($CurrentManifest.ExportedAliases.Keys | Where-Object { $_ -notin $Aliases })
if ($FunctionsAdded -or $FunctionsRemoved -or $AliasesAdded -or $AliasesRemoved) {
try {

View file

@ -1,8 +1,10 @@
function Start-7Zip {
<#
.SYNOPSIS
Running 7-Zip.
.DESCRIPTION
Checking the location of the program files and launching the program.
#>
param(

View file

@ -1,8 +1,31 @@
function Compress-7z() {
<#
.SYNOPSIS
Data compression.
.DESCRIPTION
Data compression using 7-Zip.
.PARAMETER In
Input data.
.PARAMETER Out
Output data.
.PARAMETER Type
Compression type.
.PARAMETER Level
Compression level.
.EXAMPLE
Compress-7z -In 'File.TXT'
.EXAMPLE
Compress-7z -In 'File.TXT' -Out 'D:\Docs\File'
.EXAMPLE
Compress-7z -In 'File.TXT' -Out 'D:\Docs\File' -Type 'zip' -Level 3
#>
param(

View file

@ -1,8 +1,25 @@
function Compress-7zAuto() {
function Compress-7zBulk() {
<#
.SYNOPSIS
Bulk data compression.
.DESCRIPTION
Bulk data compression using 7-Zip.
.PARAMETER In
Bulk input data.
.PARAMETER Type
Compression type.
.PARAMETER Level
Compression level.
.EXAMPLE
Compress-7z -In '*.TXT'
.EXAMPLE
Compress-7z -In '*.TXT' -Type 'zip' -Level 3
#>
param(

View file

@ -1,12 +1,21 @@
function Compress-ISO() {
<#
.SYNOPSIS
Compressing ISO Images.
.DESCRIPTION
Compressing ISO images using 7-Zip.
Calculate the hash sum of the image and compress the image with compression level 9.
.PARAMETER In
Input data.
.EXAMPLE
Compress-ISO -In '*.ISO'
#>
param(
[Parameter(Mandatory)][Alias('I')][string]$In
[Parameter(Mandatory)][Alias('I')][string[]]$In
)
(Get-Item $In) | ForEach-Object {

View file

@ -1,8 +1,16 @@
function Expand-7z() {
<#
.SYNOPSIS
Unpacking compressed files.
.DESCRIPTION
Unpacking compressed files using 7-Zip.
.PARAMETER In
Input data.
.EXAMPLE
Expand-7z -In '*.7z'
#>
param(