Last active
September 24, 2021 13:35
-
-
Save nichollsc81/eec4cb35c554349cd0475abd3834b4d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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