mirror of
https://github.com/actions/python-versions.git
synced 2025-04-06 15:29:39 +00:00
18 lines
605 B
PowerShell
18 lines
605 B
PowerShell
function Create-SevenZipArchive {
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[String]$SourceFolder,
|
|
[Parameter(Mandatory=$true)]
|
|
[String]$ArchivePath,
|
|
[String]$ArchiveType = "zip",
|
|
[String]$CompressionLevel = 5
|
|
)
|
|
|
|
$ArchiveTypeArgument = "-t${ArchiveType}"
|
|
$CompressionLevelArgument = "-mx=${CompressionLevel}"
|
|
|
|
Push-Location $SourceFolder
|
|
Write-Debug "7z a $ArchiveTypeArgument $CompressionLevelArgument $ArchivePath @$SourceFolder"
|
|
7z a $ArchiveTypeArgument $CompressionLevelArgument $ArchivePath $SourceFolder\*
|
|
Pop-Location
|
|
} |