Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
cd\
C:
$env:Owasp_path="C:\Program Files (x86)\OWASP\Zed Attack Proxy"
# cd "$env:OWASP_Path"
# cd "C:\Program Files (x86)\OWASP\Zed Attack Proxy"
# start-process .\Zap.bat -daemon -host %ProxyHost% -port %ProxyPort%
# ./Zap.bat -daemon -host $env:ProxyHost -port $env:ProxyPort -config api.disablekey=true
# start-job -scriptblock {./Zap.bat -daemon -host $env:ProxyHost -port $env:ProxyPort -config api.disablekey=true}
start-job -scriptblock {
cd "$env:OWASP_Path";
./Zap.bat -daemon -host $env:ProxyHost -port $env:ProxyPort -config api.disablekey=true
}
echo "Going in for the Sleep of 10 Seconds"
start-sleep -s 10
get-job Job1
receive-job Job1Have you tried echoing your environment vars to make sure they're set and being used effectively?
Write-Output $env:ProxyPort
If you have it working one place and not another, then you need to limit the differences and troubleshoot it.
Without some output or something more specific than "giving problems" and "does not seem to be working properly"...like there's not much we can help with.