Helper/Expand-File.ps1
function Expand-File { param ( [Parameter(Position=0, Mandatory=$true)] [string]$Source, [Parameter(Position=1, Mandatory=$true)] [string]$Destination, [string]$Password ) $Command = "& `"$env:ProgramFiles\7-Zip\7z.exe`" x `"$Source`" -o`"$Destination`" -y" + $(if($Password.Length -gt 0){" -p`"$Password`""}) if ($PSBoundParameters.ContainsKey('Verbose')) { Write-Verbose $Command Invoke-Expression $Command } else { Invoke-Expression $Command | Out-Null } } Export-ModuleMember -Function Expand-File |