PortValhalla/scripts/Windows/Scripts/BashScript.ps1

15 lines
439 B
PowerShell
Raw Normal View History

function Start-BashScript() {
param(
[Parameter(Mandatory=$true, Position=0)]
[string[]]$Content
)
Write-Information "Preparing setup script";
$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 $script;
Remove-Item $script;
}