function Start-BashScript() { param( [Parameter(Mandatory=$true, Position=0)] [string[]]$Content ) Write-Information "Preparing setup script"; $bashLocation = Join-Path (Split-Path -Parent (Split-Path -Parent (Get-Command git-gui).Source)) "git-bash"; $script = New-TemporaryFile; $script = Rename-Item $script -NewName "$script.sh" -PassThru; Set-Content $script ([string]::Join("`n", $Content)); Write-Information "Running prepared script"; Start-Process -Wait "$bashLocation" -ArgumentList @("$script"); Remove-Item $script; }