22
33function _Initalize () {
44
5- $script :_binDir = Get -ProfileDir " 7zip" " bin"
5+ $script :_binDir = szGet - ProfileDir " 7zip" " bin"
66Write-Debug " The 7-zip is dir set to $_binDir "
77$script :_7zWin = Join-Path $_binDir " 7za.exe"
88$script :_7zWinDownloadDir = ' https://www.7-zip.org/a/7za920.zip'
@@ -22,19 +22,19 @@ function Test-7ZipInstall {
2222 Write-Debug " Trying to locate 7-zip by the path: $script :_7zWin "
2323
2424 if ( -not (Test-Path " $script :_7zWin " )){
25- Write-Output ' 7Zip didn'' t found .'
25+ Write-Output ' 7Zip didn'' t downloaded .'
2626 Write-Output ' Now script going to try to download it.'
2727
28- $file = Get -TempFileName
28+ $file = szGet - TempFileName
2929 Write-Debug " Temp file: ${file} "
3030
31- Receive -File " 7-Zip" $file $_7zWinDownloadDir
31+ szReceive - File " 7-Zip" $file $_7zWinDownloadDir
3232 Write-Debug " Extracting to directory ${_binDir} "
3333 if ( -not (Test-Path $_binDir )) {
3434 New-Item - Path $_binDir - ItemType ' Directory'
3535 }
3636
37- Extract - ZipFile - FileName " $file " - Path " $_binDir "
37+ szExtract - ZipFile - FileName " $file " - Path " $_binDir "
3838 }
3939 $script :_7zPath = $script :_7zWin
4040
@@ -56,7 +56,7 @@ function AddKeyArg {
5656 $AllArgs = $null ,
5757 [string ]$Key = $null
5858 )
59- if ( -not (Test -Empty $Key )){
59+ if ( -not (szTest - Empty $Key )){
6060 $AllArgs += " -p$Key "
6161 }
6262 return $AllArgs
@@ -206,7 +206,6 @@ function Remove-ZipFileContent {
206206 [Alias (" Path" , " Name" , " Archive" , " p" )]
207207 [string ]$ArchiveName ,
208208
209- [ValidateScript ( { Test-Path $_ - pathType leaf })]
210209 [Parameter (Position = 1 , Mandatory = $true )]
211210 [Alias (" File" , " f" )]
212211 [string ]$FileName ,
@@ -364,7 +363,7 @@ function New-ZipFile {
364363 process {
365364
366365 $FileNames | ForEach-Object {
367- if ( -not (Test -Empty $_ ) ){
366+ if ( -not (szTest - Empty $_ ) ){
368367 Write-Debug " Adding file "" $_ "" "
369368 $files += $_
370369 }
@@ -432,7 +431,7 @@ function New-ZipFile {
432431 }
433432
434433
435- if ( -not (Test -Empty $ ([string ]$SplitSize ) )){
434+ if ( -not (szTest - Empty $ ([string ]$SplitSize ) )){
436435
437436 $factorName = " b"
438437 switch ( $SplitSizeFactor )
@@ -518,7 +517,7 @@ function Test-ZipFileContent {
518517 $AllArgs = @ (' t' , " $ArchiveName " )
519518
520519
521- if ( -not (Test -Empty $FileName ) ){
520+ if ( -not (szTest - Empty $FileName ) ){
522521 $AllArgs += " $FileName "
523522 }
524523
@@ -586,12 +585,12 @@ function Get-ZipFileContent {
586585
587586 $AllArgs = @ (' e' , " $ArchiveName " )
588587
589- if ( -not (Test -Empty $FileName ) ){
588+ if ( -not (szTest - Empty $FileName ) ){
590589 $AllArgs += " $FileName "
591590 }
592591
593- if ( -not (Test -Empty $destFolder ) ){
594- CreateFolderIfNotExist " ${destFolder} "
592+ if ( -not (szTest - Empty $destFolder ) ){
593+ szCreateFolderIfNotExist " ${destFolder} "
595594 $AllArgs += " -o$destFolder "
596595 }
597596
0 commit comments