Merge helpers function from node, boost, python. (#2)

* setup boost helpers

* add ci for pull requests

* pester for ci

* resolving issue with pester 5

* remove Output flag

* check tests with 4 version

* try common tests variant

* added requires

* move to 5 version

* try to add assert module

* fix scope

* use new regex for python

* fix regex in tests

* Pester 4.10.1

* EnableExit

* fix synopsys

* fix creating tar archive

Co-authored-by: Dmitry Shibanov <v-dmshib@microsoft.com>
Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>
This commit is contained in:
Dmitry Shibanov
2020-06-01 17:46:35 +03:00
committed by GitHub
parent 8affb5df76
commit d8c3ce72ee
13 changed files with 422 additions and 184 deletions

39
win-helpers.psm1 Normal file
View File

@@ -0,0 +1,39 @@
<#
.SYNOPSIS
Unpack *.7z file
#>
function Extract-SevenZipArchive {
param(
[Parameter(Mandatory=$true)]
[String]$ArchivePath,
[Parameter(Mandatory=$true)]
[String]$OutputDirectory
)
Write-Debug "Extract $ArchivePath to $OutputDirectory"
7z x $ArchivePath -o"$OutputDirectory" -y | Out-Null
}
function Create-SevenZipArchive {
param(
[Parameter(Mandatory=$true)]
[String]$SourceFolder,
[Parameter(Mandatory=$true)]
[String]$ArchivePath,
[String]$ArchiveType = "zip",
[String]$CompressionLevel = 5,
[switch]$IncludeSymlinks
)
$ArchiveTypeArguments = @(
"-t${ArchiveType}",
"-mx=${CompressionLevel}"
)
if ($IncludeSymlinks) {
$ArchiveTypeArguments += "-snl"
}
Push-Location $SourceFolder
Write-Debug "7z a $ArchiveTypeArgument $ArchivePath @$SourceFolder"
7z a @ArchiveTypeArguments $ArchivePath $SourceFolder\*
Pop-Location
}