Skip to content

Instantly share code, notes, and snippets.

@nichollsc81
Last active September 24, 2021 13:35
Show Gist options
  • Save nichollsc81/eec4cb35c554349cd0475abd3834b4d5 to your computer and use it in GitHub Desktop.
Save nichollsc81/eec4cb35c554349cd0475abd3834b4d5 to your computer and use it in GitHub Desktop.
[string]$(deploymentPath)
[string]$(FORWARD_PORT)
$ErrorActionPreference = 'Stop'
echo "starting function"
# set runtime location
[string] $ArgumentList = "powershell.exe -command ""set-location $(deploymentPath);func start --port $(FORWARD_PORT) --verbose"""
Write-Host "Executing:: $ArgumentList"
try
{
# start powershell process without child relationship
Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList $ArgumentList -Verbose
}
catch
{
$_
[Environment]::Exit(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment