2023-11-19 17:41:47
This commit is contained in:
parent
627fa73153
commit
2193182f77
|
@ -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 = @()
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
function Start-7Zip {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Running 7-Zip.
|
||||
|
||||
.DESCRIPTION
|
||||
Checking the location of the program files and launching the program.
|
||||
#>
|
||||
|
||||
param(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(
|
|
@ -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 {
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue